The pyRevit rapid application development environment can be used for the entire add-in lifecycle, supporting rapid debugging, testing and deployment as well. I successfully implemented invoking an external command defined in a stand-alone Revit plugin assembly from pyRevit! It's proving extremely useful...
Today, yet another introduction to Forge, a simple issue of setting the level of a floor element, and the much more complex one of gaining freedom and total independence via IPC – What is Forge? – Changing the level of a floor – Entanglement can be hell – CefSharp entanglement – Disentanglement and independence via IPC – Beer-ware license...
Today I discuss (once again) an important performance aspect of Revit element filtering, a Python script for tagging JPEG images with EXIF data, prompted by a recent ski tour, and three other interesting topics that caught my eye – Slow, slower still and faster filtering – Python JPEG EXIT filename tagging – TED talks and population growth – Objective reality does not exist – Artificial intelligence judge...
As usual, I have been much too active in the Revit API discussion forum recently and worked too little for my taste here in the blog. Here are some of the recent items that I want to share plus a few pictures from my latest mountain outing – Marat's shapka ushanka and Balmer's Graetli – Naveen is a top solution author now – Revit et BIM en Français – Tree view performance optimisation – Underture...
Some interesting settings are stored in and can be modified by editing the Revit ini file. Peter @pgerz pointed out yet another possibility in his answer to the Revit API discussion forum thread on adding a project template to 'New Project' via API. Question: I noticed the UI method for adding a project template to the 'New Project' dialog on the Start Window by going to Options > File Locations and clicking the little plus symbol...
Let's tackle a 2D fire rating zone intersection task. Actually, it was originally raised a 3D intersection task. Reducing it to 2D makes it much more tractable – 3D solid extrusion creation and intersection task – 2D area intersection task – Jack's sample and description – Soffit subdivision sample code – Cleanup and GitHub repository...
If you are interested in Forge programming, don't miss the upcoming deadline for proposals for the Boston Forge accelerator! Looking at the Revit API, I migrated my sample demonstrating how to enable ribbon items in zero document state to Revit 2019. Let's look at that, and another recurring topic, on loading add-in support DLLs – Migrating the ZeroDocPanel to Revit 2019 – Loading add-in support DLLs – Rome and Boston Forge accelerators...
I updated the Visual Studio Revit C# and VB add-in templates for Revit 2019. They enable you to create a new C# or VB Revit add-in in Visual Studio with one single click on File > New > Project... > Visual Basic/Visual C# > Revit 2019 Addin and define a complete skeleton Revit add-in, ready to immediately compile and run, including an add-in manifest file, external application and external command. Just hit F5 to start debugging; the add-in manifest is installed, Revit launched and the command is immediately available...
Today is The Building Coder's tenth birthday! The first post was a warm welcome on August 22, 2008. Very many thanks to the entire community for all your support, interest, comments and above all numerous contributions over the years! Today, let's pick up the recurring topic of accessing the Revit API from a modeless context...
I am back from a multi-day hike of about 70 km along the Swedish Sörmlandsleden wilderness trail. In the meantime, lots of noteworthy things happened – Revit 2019.1 update and features – Revit Add-Ins using the CEFsharp library – BIM 360 Issues API – Forge Accelerator in Rome and elsewhere – Looking for a Forge development partner – New way to retrieve a parameter id...
Here comes another solution for efficiently compiling add-ins for multiple Revit version targets from one single code base, a note on resources for CAD term databases for consistent terminology translation, and a discussion on accessing custom texture maps in Forge and Revit
– Multi-targeting Revit versions using
– Further enhancement using the
– CAD terminology resources for consistent translation
– Showing a custom Revit texture map in the Forge Viewer...
Apparently, the Revit SDK REX Visual Studio templates are obsolete. Let's fix that problem. Also, two little notes on a C# optimisation trick for math-heavy code, and the current status of the Forge Design Automation API for Revit – Revit Structure 2019 REX Extension SDK Visual Studio Templates – Improve C# Performance Using Struct Instead of Class – Update on the Forge Design Automation API for Revit...
Every time I created a ribbon button, I was faced with the task of creating appropriately scaled icons for it to populate the
PushButton large and small image icon properties
They seem to expect a 32 x 32 and 16 x 16 icon, respectively.
I finally solved that once and for all by implementing a couple of methods to perform automatic bitmap scaling
– BitmapImageToBitmap – convert a
– BitmapToBitmapSource – convert a
Bitmap to a
– ResizeImage – resize an image to the specified width and height
– ScaledIcon – scale down large icon to desired size for Revit ribbon button
– Usage sample – putting them together...
I installed Revit 2019 and compiled the Revit 2019 SDK.
That was quite a struggle
– Installing Revit 2019
– Installing the Revit 2019 SDK
– Installing the .NET Framework 4.7
– Compiling the Revit 2019 SDK samples
– Processor architecture mismatch warnings
– Numerous Revit API assembly reference conflicts
– SampleCommandsSteelElements lacks components
– AppearanceAssetEditing using deprecated API...
A discussion with Håvard Dagsvik on the use of
TransmissionData, standalone access to the
BasicFileInfo without the need for a valid Revit API context, and a Revit-independent method replacing
– No document required for
TransmissionData requires a valid Revit API context
GetFamilyXmlData method replacing
– Windows explorer
BasicFileInfo right click utility...
Dragos Turmac of the Revit development team solved the Revit API discussion forum questions on contextual help not working from within a command and on F1 help for add-in only by explaining the current best practice to implement online help – Question: I'm trying to add contextual help for all commands (press F1 to go to a location). It's working fine when the tooltip is shown for my commands, but, when the add-in form is open, pressing F1 opens the Autodesk knowledge site for Revit instead...
Александр Пекшев aka Modis @Pekshev submitted a very succinct and useful pull request for RevitLookup that I integrated right away, and provides many other valuable inputs as well – Snoop stable representation of References – Project point on plane correction – Revit export geometry to AutoCAD via XML – RevitExportGeometryToAutocad – Description – Versions – Using – Example...
Question: I am trying to create a swept blend geometry and assign it to a
The initial code threw an exception when calling the
How can I fix this?
Answer: The path parameters assume that they should be normalised or that the curve has a range of parameterisation from 0 to 1...
Alexander Ignatovich shares an exceedingly elegant solution for automatic wall creation, illustrating a number of important concepts and implementing the following functionality very succinctly indeed
– Retrieve all the
cube family instances
– Retrieve their
height parameter value
– Retrieve their solids making use of the .NET
– Extract their horizontal outline contours using an
– Create walls along each contour curve segment
– Place a door family instance at the midpoint of each wall...
I am attending the Forge DevCon conference in Darmstadt, Germany, right now, and putting the final touches to my presentation on Rational BIM programming using Revit and Forge at the European Autodesk University on Wednesday. We discussed several different approaches to retrieve the outer loop of a planar face. Richard Thomas recently shared a possible solution to determine the outer-most EdgeLoop. He now posted a new approach: I found a more straightforward and likely reliable way of getting outer loops of planar faces. This method also allows for faces made up of disjointed parts...
I am back from a nice break in Italy. Next, I am attending the European Autodesk University in Darmstadt, Germany. Meanwhile, solutions for two issues on keeping Revit focused and on top when working with a modeless form, and an important heads-up warning from the Revit development team on a future change coming. We here at Ideate Software are seeing what appears to be Revit add-in ownership issues with Revit's main window. The behavior has changed between Revit 2017 and Revit 2018 for modeless add-ins. For Revit 2018, when a modeless add-in is closed, Revit does not retain is focus; it is pushed behind another application...
Håvard Dagsvik of Symetri implemented code to automatically generate a dictionary mapping the Revit
DisplayUnitType to corresponding
UnitSymbolType display strings. The developer guide describes these classes like this
– UnitType – type of physical quantity to be measured, for example length or force (UT_Length or UT_Force)
– DisplayUnitType – units and display format used to format numbers as strings or convert units (i.e. DUT_METERS)
– UnitSymbolType – unit symbol displayed in the formatted string representation of a number to indicate the units of the value (i.e. UST_M)...
A biggish post rather late in the week... still answering too many cases – Forge for AEC demos and sample code – Determining the starting view – Detecting installed Revit version – Detecting installed C3D version – Moving items inside a detail group – Filtering for family instances and types by family name...
A recurring question just came up again, on handling conflicts between DLLs loaded by Revit add-ins. For instance, this can be caused by a scenario in which add-ins A and B both make use of library DLL C, but specify different versions. A soon as the first add-in has loaded its version of C, the second add-in is prevented from loading the version it requires and cannot run...
In Revit 2018, cancelling family instance placement during a call to
PromptForFamilyInstancePlacement throws an
– Easily fixed, once discovered
– Change in Behaviour
– Exceptions Should be Exceptional
– The Building Coder samples
We are currently being flooded with questions about a topic that has already been discussed repeatedly and in depth in the past, external access to the Revit API. Possibly, the cause is the growing interest in implementing web driven solutions to generate RFA and RVT files. It is in fact possible to implement a web server driving Revit in the background to execute such tasks, as demonstrated by the old sample showing how to drive Revit through a WCF service and other examples listed in the topic group on Idling and external events for modeless access and driving Revit from outside – Revit I/O and Forge – Question – Answer...
I updated the Visual Studio Revit C# and VB add-in templates for Revit 2018. They enable you to create a new C# or VB Revit add-in in Visual Studio with one single click on File > New > Project... > Visual Basic/Visual C# > Revit 2018 Addin and define a complete skeleton Revit add-in, ready to immediately compile and run, including an add-in manifest file, external application and external command. Just hit F5 to start debugging; the add-in manifest is installed, Revit launched and the command is immediately available...
I completed a first revision of the ForgeFader project, bringing it up to par with RvtFader. It is pretty cool seeing the same functionality implemented in two such different ways, on completely different platforms, using different tools. Alan Seidel shared another exciting Revit add-in. First and not least, another exciting topic for me personally is switching to half-time work – Work half – AKS Opener – Video – GitHub repository – Why? – Specific interest – RvtFader – ForgeFader...
I implemented a neat new little sample add-in, RvtFader, that calculates and displays signal attenuation caused by distance and obstacles, specifically walls. It uses two very interesting pieces of Revit API functionality – AVF, the Analysis Visualisation Framework, for displaying graphical data in a transient manner directly in the BIM – The ReferenceIntersector ray tracing functionality to detect walls and other obstacles between two points. In the course of implementing the AVF part of things, I also resuscitated my trusty old RevitWebcam add-in – RevitWebcam – RvtFader – Task – Implementation – Further Reading...