Let's revisit the ever-recurring topic of retrieving all model elements, and also look at a well-documented workflow for retrofitting historical buildings.
Workflow for Retrofitting Historical Buildings
If you are interested in the detailed description of a workflow for retrofitting historical buildings, the renovation of the Milano Teatro Lirico opera house may provide a worthwhile read.
The almost 10,000 square meter, 1500-seat theatre renovation weighs in at over 16 million euros in cost.
A technical team using a Leica laser scanner captured the detailed theatre geometry, producing 550 scans with 6.5 billion points.
The point cloud data was processed to generate an accurate 3D virtual model of the theatre in its current state using:
- ReCap for point cloud management
- Revit for the creation of the 3D existing conditions model and the development/assessment of design alternatives
- 3ds Max to generate photorealistic project visualizations
The whole process is extensively documented in the Autodesk University class RC9940 handout document and the 6-minute video on Teatro Lirico:
You need a login and password to download the AU material. You get those for free by registering at the site. It is a very useful resource to explore and learn more about all Autodesk products and topics related to the industries and workflows using them.
Retrieving All Model Elements
'All model elements' means something different to every application, of course, so you will always need to adapt the details to your own needs.
This topic was prompted by several recent cases and the Revit API discussion forum thread on all model elements in project:
Question: How can I get the model elements? This old code from The Building Coder discussion on selecting model elements does not work anymore. Thank you in advance.
Answer: Yes, indeed, the code that you are pointing to is pretty old.
However, as pointed out in that post, the code is part of the ADN Revit API training material, in the Revit API Introduction Lab 2-2.
That material is continuously maintained, and an up-to-date version is available from two separate GitHub repositories:
- Autodesk Revit Training material, the official training material pointed to from the Revit Developer Centre
- ADN Revit API Training Labs including Xtra, an enhanced version maintained by my humble self
You could grab the current version from there, if you like, e.g., directly from XtraCs/Labs2.cs.
Furthermore, luckily for you, a number of different other approaches to solve this very issue have been presented by The Building Coder in the topic group on filtering for all elements.
I just updated the links under 'Selecting Model Elements or Visible 3D Elements' for you, listing the following possibilities:
- Valid category and non-empty geometry
- Ditto, and eliminate certain categories
- Valid category and neither category nor element is hidden
- Based on the Category.HasMaterialQuantities property
- Based on the elements visible in a default 3D view
- Using a custom exporter
I hope this helps.