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...
Last week, I presented Andrey Bushman's new Visual Studio templates for Revit add-ins. Furthermore, we discussed many aspects of edit and continue in the past, including the solution to use the Add-in Manager. These two topics have now met and united, because Andrey added support for that and a bunch of other new functionality in his commit...
Last week, I presented a drastic change to RevitLookup using
Reflection to provide more complete coverage of all the Revit database element methods and properties. Victor Chekalin took a critical look at this new version and cleaned it up significantly. Now all is well and order has been restored again
– Shock and gripe
– Commit summary
– 1. Methods and properties extraction
– 2. Show enum values
– 3. Drill down into
– 4. Remove duplicate
get_ property getter method
– 5. Fixed
– 6. Visual style of separator
– Download and access to old functionality
– Reaction and read-only assurance...
I have been maintaining a simple Visual Studio Revit add-in wizard for a number of years. Now Andrey Bushman implemented a set of more advanced and convenient Visual Studio templates for creation of Revit add-ins for his own use. The discussion of those led us to once more revisit the topic of the Visual Studio settings for debugging Revit add-ins – New Visual Studio 2015 templates for Revit add-ins – Use Managed Compatibility Mode or Enable Native Code Debugging? – Machine learning software engineer job in Switzerland – FreeCodeCamp...
Today, I present a large and drastic contribution to RevitLookup from Andy @awmcc90 McCloskey of RevDev Studios that will help significantly in supporting both past and future releases of Revit
– Drastic changes making use of object inspection via
– Cross version compatibility
– Removal of events and unused functionality
– Commit summary
– File Changes
Most of the work of the year has been done, and it is time to settle down and clear out for the new. Tomorrow is the winter solstice, followed by Christmas and Yuletide, ending with the Twelfth Night. For me, this is a time of retreat, calm, reflection, and renewal of energy. Today brings a nice gift from Andrey Bushman – NuGet Revit API package – RevitLookup using the NuGet Revit API package – Creating a NuGet package from assembly DLLs – More NuGet packages...
Two topics today, on reordering viewports to determine their respective occlusion, and setting up a C++ Revit add-in project – Bringing a viewport to the front – Change the draw order of a viewport (bring to front) for cases when you need to use simplified duplicate of the same view for background, e.g., ceiling grid for example – Code clean-up – Setting up a Visual Studio C++ Revit add-in project...
I am in the last stages of preparing my presentation this afternoon on connecting the desktop and the cloud for the RTC Revit Technology Conference Europe. For your and the audience's convenience, here are the materials I am presenting, and some of the main links to further information – Handout – Slide deck – Recording – Samples Connecting Desktop and Cloud...
Last week, I worked with Kean Walmsley on his entry for the first global Autodesk Hackathon: a HoloLens-based tool for navigating low visibility environments, resulting in the new HoloGuide Autodesk Hackathon project. My modest contribution is the ExportWaypointsJson Revit add-in, an external application implementing the main command, exporting the waypoints, and a subsidiary option settings command, displaying a form, validating input and storing the user preferences. The main command simply prompts the user to pick a model line in the Revit project, traverses it, determines waypoints at predefined intervals and exports them to JSON for consumption by the HoloGuide visualisation...