Many thanks to all the numerous brilliant contributors to the Revit API discussion forum, above all, during the past weeks, Richard RPThomas108 Thomas, continuing to provide tremendous help on the hard questions requiring both Revit API understanding and in-depth product usage experience.
Meanwhile, for today, let's take a quick look at a fix for the RvtVa3c custom exporter and a Forge issue related to Revit property access:
Question: I am looking for a way to pull metadata from all the Revit files that live in BIM 360 using Forge to then represent it on PowerBi.
I looked at a previous suggestion on using the Design Automation API but was unable to use that because it requires
ngrok, which is not approved by my company.
Also, as far as I can tell from the forge-customproperty-revit documentation on extracting compound layer information with the Revit engine, it would have to go to each file, one by one, to extract this meta data.
However, I can see the required data with the model viewer API. I was informed that even though I could view it, I would not be able to extract it using that API.
The data lives in Revit with in the sheet properties, in the section labeled identity data:
Answer: Two quick comments off-hand:
First, I find it hard to believe that the Design Automation API requires
ngrok. At least, I have never heard of such a requirement.
Response: Correct, the Design Automation API doesn’t need ngrok. I meant to say that it was needed for the example in the link that I included that Forge Support suggested using as a starting point. Sorry for the confusion.
As for the Viewer API, I previously asked someone from a Forge program and they informed me that I would be able to see it but not extract it because that isn’t built into the API.
For safety's sake, I asked my more knowledgeable colleagues to confirm. The development team confirmed my original statement:
Answer: You can find the correct statement inside the
viewer3d.js source file:
Autodesk Forge Viewer Usage Limitations:
The same text is available in the documentation, at the bottom of the developer guide overview.
Response: Thank you for that clarification.
However, it does not answer my question.
Answer: Yes, using
GET Properties endpoint.
They cannot be modified, the viewer (being a viewer) is read-only.
If the model is already loaded, it is better to use the JS API directly, rather than the Forge REST API, because all properties are automatically downloaded by the viewer and available locally to the JS context.
Conclusion, yet again, expanded and reinforced: you can use JavaScvript to access all properties visible in the Forge viewer.
Doing so will save you time, effort and money:
- The properties are all already loaded
- There is no need for additional Forge REST API programming effort
- There are no Forge DA4R workitem costs associated
In case you would like to dive in a bit deeper into Forge today, the full articles and video recordings of the Forge classes at AU classes are available online for your convenience and enjoyment; here are links to the Forge community blog articles and YouTube recordings:
- Forge for Construction – recording
- Forge for Manufacturing – recording
- Forge for Building Design – recording
- Forge for Civil Infrastructure – recording
- Forge Hackathon Showcase – recording
- Forge Fire Faceoff – recording
The error was easy to fix, presumably also resolving Issue #17 – Error In Revit 2019, and also prompting me to update the project to Revit 2021.
Many thanks to Jake for raising the issue and confirming the fix.