简体   繁体   中英

Autodesk Forge API: How can I access the count of elements of a BIM model that is displayed in the Model browser via the API?

I need to filter out all parents and childs to obtain only BIM model information about the individual elements of the BIM model. In the Model browser the total counts of individual elements are displayed, but I cannot figure out how to get this information via the API. Below is a picture of what I'm am talking about

1个

How can I access the count of elements of a BIM model that is displayed in the Model browser via the API?

Suppose the dbId of the parent node 16.12-f...ihw, recht:500x 600 is 1234.

To get its child count, just call InstanceTree#getChildCount on it.

let model = viewer.getAllModels()[0];
let it = model.getInstanceTree();
let nChild = it.getChildCount( 1234 ); //!<<< here you go

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM