-
I'm trying to get a list of properties for each object in a Revit file. Something similar to this (from Forge's Derivatives API): {
"objectid": 1,
"name": "A5",
"externalId": "mou0zG8ViUOsqUzhb4TUiA",
"properties": {
"Name": "A5"
}
},
{
"objectid": 2,
"name": "Model",
"externalId": "z4u0zG8ViUOsqUzhb4TUiA",
"properties": {
"Component Name": "Model",
"Name": "Model",
"Design Tracking Properties": {
"Design State": "WorkInProgress",
"Designer": "ADSK",
"File Subtype": "Assembly"
},
"File Properties": {
"Author": "ADSK",
"Creation Date": "2012-Jul-09 20:18:20",
"Original System": "Autodesk Inventor 2017",
"Part Number": "Model"
},
"Mass Properties": {
"Area": "19772.676 millimeter^2",
"Volume": "83673.946 millimeter^3"
}
}
}, I've attempted to use the iModelConsole to run some ECSQL queries but haven't been able to find the right query. I see that there is an example in the Simple Viewer App, however I've been unable to explore this. The Revit files I've tried successfully load, but I receive an How can I accomplish this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What method do you prefer? Is your question how to obtain data using ECSQL (e.g. iModelConsole) or using iModelJS API? I think any ECSQL query should be tested in iModelConsole at first, before it's implemented in a code.
I know it's a bit of meticulous comment, but I guess you don't want a list of properties, but a list of properties values. ;-) The list of properties is defined by a class structure, whereas the properties values represent data stored with the object.
I think it's hard to compare, because as far as I understand, Forge API is REST API, whereas iModelJS is TypeScript library, that can be used to communicate with iModelHub. I think iModelHub does not publish any public REST API that can be used to obtain model data directly.
I have not any imodel created from Revit data available, so I do not know its structure and how conversion was done (and what schemas were used), so my recommendation is general. It's based on assumption you have the imodel available at iModelHub.
I recommend to see ECSQL tutorial to find typical queries, but I assume it will be similar to a standard basic query structure:
To select all generic elements, when a plain geometry was converted to iModel and they are not described using special classes:
With regards, Jan |
Beta Was this translation helpful? Give feedback.
-
Using ECSQL for getting all properties of an element is really not an option, because majority of the properties are usually located on related element aspects, types, etc.. To simplify getting iModel data in a user and developer -friendly way we suggest using the Presentation API which looks up for all the related properties for you. You can find an example of how to use the API directly here - have a look at the I also checked the simple-viewer-app and was able to reproduce the issue you're seeing. It's caused by the |
Beta Was this translation helpful? Give feedback.
Using ECSQL for getting all properties of an element is really not an option, because majority of the properties are usually located on related element aspects, types, etc.. To simplify getting iModel data in a user and developer -friendly way we suggest using the Presentation API which looks up for all the related properties for you.
You can find an example of how to use the API directly here - have a look at the
listElementProperties
method. Note that the example is for backend code, but the API on the frontend is nearly identical.I also checked the simple-viewer-app and was able to reproduce the issue you're seeing. It's caused by the
Table
component in the app - if you comment-out the …