简体   繁体   中英

Select multiple objects in Autodesk Forge viewer

My Scenario:

I'm reading an IFC file ( using api/forge/modelderivative/modelViewProperties) and categorizing objects using the IFC type.

Therefore I need to select objects/highlight when you click on a particular type.

ex: if you click on type "IFCBUILDINGSTOREY" model should be able to highlight the child objects like level1,level2 etc...

at the moment i tried both

viewerApp.getCurrentViewer().isolateById(idArray)

viewerApp.getCurrentViewer().select(idArray, Autodesk.Viewing.SelectionMode.REGULAR );

but nothing seems to be working... any advice?

thanks

edit:

version

  <script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/6.*/viewer3D.min.js"></script>

and the JAVA SDK

        <dependency>
            <groupId>com.autodesk</groupId>
            <artifactId>forge-java-sdk</artifactId>
            <version>1.0.1</version>
        </dependency> 

I'm getting the properties using "forgeviewer/api/forge/modelderivative/modelViewProperties"

There are different ways to search for objects with specific properties. Typically you can use the search method. This will return the IDs of all objects containing a specific phrase in one of its property names or property values. From this list you could then filter the objects further as needed, for example, by getting the properties of individual objects using the getProperties method, or by requesting the properties of several objects at once using the getBulkProperties method.

Once you have the IDs of the objects you are interested in, you can highlight them in different ways, for example, selecting them using the select method, or hide everything else but these objects using the isolate method.

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