Today, we revisit the interesting and generic question on retrieving all exterior walls. That may be easy in a perfect and complete model. However, it raises some challenges in an incomplete BIM – Retrieving all exterior walls – Several possible approaches – Using a computational geometry approach – Manually adding the huge surrounding room – Encapsulate transactions and roll back instead of deleting – Determining model extents via wall bounding box – Implementing the huge surrounding room approach – Retrieving family instances satisfying a filter rule...
After the significant struggle I had to compile the initial release of the Revit 2019 SDK samples and set up RvtSamples 2019, I am happy to report that installing and compiling the Revit 2019 SDK April 27 update is a lot easier
– Downloading the April 27 SDK update
– Initial compilation – 41 warnings
– Processor architecture mismatch suppressed – 5 warnings
– Update reference to
RevitAPISteel.dll – 3 warnings
– Setting up
How to export all the Revit data to an external database?
It is very simple to extract all the parameter data.
Let's implement a solution to do so
– Existing sample implementations
– Black box input
– Choices for the output and its structure
– Retrieve parameter values from an element
– FilterCategoryRule versus category filters
– Category description extension method
– Retrieve parameter data for all elements of given categories
– External command
– Sample run results
Today, we explore how to retrieve visible DWG geometry, i.e., geometry elements contained in a CAD import instance on a layer that is visible in the currently active view, and how to import an image to the foreground instead of the default background setting – Retrieve CAD import geometry on visible layer – Import image using foreground option...
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 am excited to announce a number of new opportunities to come and join me and my closest colleagues in our work supporting external developers in their use of the Forge web programming technologies. Also, before closing for the week, I'll mention two interesting reads for the weekend, by Sasha Crotty on moving from Collaboration for Revit to BIM 360 Design, and by the World Economic Forum WEF on an action plan to accelerate BIM adoption – Would you like to come and work with us? – From Collaboration for Revit to BIM 360 Design – An action plan to accelerate BIM adoption...
Following up on yesterday's discussion of What's New in the Revit 2019 API, here is a webinar invitation to walk through the results live from the product point of view. I also share a high-level comparison of some aspects of Forge versus A360 for a total newbie thinking about building a solution for a client to manage 3D models and collaborate on them with sub-contractors – Webinar on What’s New in Revit 2019 – Forge versus A360...
The Revit 2019 API includes numerous exciting enhancements for add-in developers. Many relate directly to explicit developer wishes and requests – Information sources – Installation and migration from previous versions – What's new in previous versions – What's new in the Revit 2019 API – API Changes – API Additions...
I set up RvtSamples for the Revit 2019 SDK samples. Just like the migration to previous versions, this is not a trivial undertaking. To cut a long story short and simply share my current working RvtSamples source code for the Revit 2019 SDK, here is RvtSamples_2019.zip containing my modified files...
I already described how I installed Revit 2019, compiled the Revit 2019 SDK samples and migrated RevitLookup to the new version.
I now migrated some of the other basic samples and utilities and have some Forge news to share
– The Building Coder samples for Revit 2019
AdnRme MEP HVAC and electrical samples for Revit 2019
– AdnRevitApiLabsXtra for Revit 2019
– Convert RVT to IFC via Forge
– Forge accelerators
– Forge webinars
– Open position for an infrastructure BIM implementation consultant...
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...
Here are a couple of threads from the Revit API discussion forum related to MEP and connectors from the past few weeks that seem worth taking note of – Traversing an MEP system and retrieving connected elements – Reproducing the MEP electrical system browser hierarchy – Creating a conduit between two connectors – Dealing with the read-only transition diameter...
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...
Several questions on filtering for intersecting elements came up recently. It is pretty easy as long as a bounding box can be used. However, the bounding box is generally aligned with the cardinal X, Y and Z axes. If the containing volume of interest is not, too many elements may be selected – Family instances in a diagonal room – Conduits intersecting a junction box – Generate 2D arc from radius, start and end points...
Александр Пекшев 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...
An add-in will often need to retrieve the elements that it just created for further processing. Frequently, the Revit API method used to create them will return their element ids. Sometimes, that is not the case. Now this topic arose again in a couple of cases and brought some other aspects to mind – Using the element lister – Consecutive element ids – Retrieving recently added elements – AEC job openings in Munich and elsewhere...
Questions on how to use
NewFamilySymbolProfile have come up a couple of times in the Revit API discussion forum.
The short answer is: retrieve the family symbol from the profile family, then call the creation application
I implemented a new sample add-in for you to demonstrate the steps using the Profiles_L-Angles.rfa profile family...
Some insight on the use of the
MergedViews property provided by the DGN, DWG and DWG export options classes and other ideas to export multiple views into a single DWG file
– Question: I want to combine and export multiple views into one single DWG file. I set the option
MergedViews, but the code still generates multiple DWG files for the views...
Konrads Samulis shared a very nice solution to retrieve the crop box for a given view using a highly efficient parameter filter in
his comment on rotating a plan view.
In digging up this old thread, I found something quite curious in the API in 18.1, that I'm not sure was there before.
The method of using a temporary transaction (with rollback) to find the element id of the crop box was taking a very long time on a large model, so I did a bit of digging to see how I could improve it.
I noticed that in the built-in parameter
ID_PARAM of the crop box contains the element id of the view it's in.
E.g., the crop box 'points' to the id of the view it is in using
Is there a way to return failure information to your main command when creating a transaction?
My program does some error logging and creates an error report at the end, and I'd like to include some information from specific types of Revit failures (i.e., include if multiple instances were created in the same place).
Yes, you can use the
PreprocessFailures method argument
failuresAccessor to review and store failure message information for later use...
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...
Christian Thieme of the Chair of Computational Modeling and Simulation at TUM, the Technical University Munich, shares his tools connecting Revit to the MomenTUM agent-based pedestrian simulation framework
– Giving something back to the community
– Project overview
– Export workflow
– Import and display results workflow
– Transformation from
Revitalizer shared two important hints: a performance issue using
ElementTransformUtils and a problem reporting mechanism built into the
First, though, let's highlight an even more important upcoming event, the series of DevDays online webinars
– Register now for Autodesk DevDays online webinars
– Avoid using
ElementTransformUtils for batches
– Finding cause of
DirectShape generation problem...
I'll begin the new year by discussing a bunch of topics addressing various aspects of
– Updated DirectShapeFromFace
– Improve loft form creation speed using
DirectShape instead of conceptual mass
– Create surface from face
DirectShape from solid
DirectShape colour and material
– Improve family performance suppressing
DirectShape from room...
Two recent Revit MEP related cases brought up some new information on the pipe
K factor table and custom calculations for pipe fittings, the Forge DevCon class recordings are now available, and I discovered Konrad Sobon's wonderful archi+lab Revit API blog, which helps resolve an installation and setup issue
K factor table
K factor calculation for pipe fittings
– Dynamo code to change loss coefficient
– Forge DevCon 2017 class recordings
– Revit add-in installer and buttons...
I'm trying to retrieve connected framing elements through the API.
My end goal is to select a beam and retrieve the element id of the elements its ends are framing into.
I have been able to do this by checking location intersection of all other beams, but this scales by
n^2 based on the number of beams for the check.
I read the article on finding connected structural elements, but I'm confused on the actual implementation of it.
Has anybody come across a working example showing how to
Let's discuss the Revit API enhancements added since the initial release of Revit 2018 – Revit 2018.2 Product Update and Resolved API Issues – Revit 2018.2 SDK Update – Major Additions to the Revit 2018.1 API – Material API additions – Geometry API additions – BrowserOrganization API additions – IFC additions – Rebar API additions – Major Additions to the Revit 2018.2 API – Fabrication API additions...
I went on my first ski tour this season...
lots of interesting issues in
the Revit API discussion forum...
a Japanese case on programmatically generating a mass floor, enabling us to mention yet another hitherto unmentioned Revit API usility class,
Please tell me if a method exists to generate a mass floor using the API...