Select Autodesk Forge 查看器中的多个对象

Select multiple objects in Autodesk Forge viewer

我的场景:

我正在读取 IFC 文件(使用 api/forge/modelderivative/modelViewProperties)并使用 IFC 类型对对象进行分类。

因此,当您单击特定类型时,我需要 select objects/highlight。

例如:如果您单击“IFCBUILDINGSTOREY”类型,模型应该能够突出显示 level1、level2 等子对象...

目前我都试过了

viewerApp.getCurrentViewer().isolateById(idArray)

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

但似乎没有任何效果...有什么建议吗?

谢谢

编辑:

版本

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

和 JAVA SDK

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

我正在使用“forgeviewer/api/forge/modelderivative/modelViewProperties”获取属性

有多种方法可以搜索具有特定属性的对象。通常您可以使用 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 方法。

获得感兴趣对象的 ID 后,您可以用不同的方式突出显示它们,例如,使用 select method, or hide everything else but these objects using the isolate 方法选择它们。