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...
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...
Question: How can I set the Material Render Appearance through the API?
I can see there is the
Autodesk.Revit.DB.Visual.Asset class, but how do I add to the list of
Autodesk.Revit.DB.Visual.AssetProperty objects for a new material?
Answer: The good news is that this is possible in Revit 2018.1 using the Visual Materials API.
Check out Boris Shafiro's class at AU to learn about it...
Migrating a Revit add-in to a new release of the Revit API is generally very easy. The API features slight changes from version to version. Modifications are announced a year or two in advance, and signalled during compilation by deprecated API usage warnings. If you clean up your code every year or two and remove all API usage that causes warning messages, you will normally have very little to do to migrate it later on...
A "don't miss" list of the main highlights and a heads-up on some of the biggest happenings – See into the future of Forge with partner and executive keynotes – Choose from over 50 AU classes on ways to take advantage of cloud solutions – Visit the Village, an exclusive exhibit open only to Forge DevCon attendees – Demo and witness first hand the new AR/VR Toolkit – Get to know Amazon Web Services through these classes and exhibits...
My plans changed and I will not be visiting Las Vegas this year after all. The most important participants in the Revit API session that I was preparing to host are the members of the Revit development team, anyway. I very strongly urge you to not miss the chance to attend both AU and the preceding Forge developer conference, though – Forge DevCon highlights and reasons to join your peers – Sneak peek at the Forge DevCon keynotes – Visit the exclusive Forge DevCon village on Monday – Get one on one with Amazon Web Services – Decide now...
A quick geometrical question on retrieving geometry from a basic wall being used as a panel in a curtain wall.
I am struggling to retrieve the geometry data from a curtain wall that contains a Basic wall in one of the curtain wall panels. My example curtain wall has two panels. With one of the panels, a basic wall type is associated. I need to get the geometry data (i.e., the faces) for the entire curtain wall. When I reach the second panel in my code, the
SymbolGeometry contains zero objects, so my code cannot retrieve any geometry for it...
Here is an official answer from the Revit development team on the long-standing and recurrent issue on retrieving the path to a specific material texture bitmap file
– Question: I am working on an exporter plugin for Revit that exports all geometry from selected objects using the
When extracting object materials, I can successfully get most of the information, but I can't seem to find the path to the material texture
I completed the presentation and recording of my presentation yesterday on Rational BIM programming using Revit and Forge at Autodesk University in Darmstadt, Germany
– Rational BIM Programming recording
– Pleasant walks in the Odenwald
– Some of my favourite recent books
– Where to continue after finishing school
– New AlphaGo Zero is completely self-taught
I am attending Autodesk University in Darmstadt, Germany, and putting the final touches to my presentation tomorrow on Rational BIM programming using Revit and Forge. Here are the slides and the handout document in their current state in PDF format – Slide deck – Handout document – For your convenience, here is the full text of the latter as well...
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...