简体   繁体   English

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

[英]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.我正在读取 IFC 文件(使用 api/forge/modelderivative/modelViewProperties)并使用 IFC 类型对对象进行分类。

Therefore I need to select objects/highlight when you click on a particular type.因此,当您单击特定类型时,我需要 select 对象/突出显示。

ex: if you click on type "IFCBUILDINGSTOREY" model should be able to highlight the child objects like level1,level2 etc...例如:如果您单击“IFCBUILDINGSTOREY”类型,model 应该能够突出显示诸如 level1、level2 等子对象...

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和 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"我正在使用“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.这将返回在其属性名称或属性值之一中包含特定短语的所有对象的 ID。 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.然后,您可以根据需要从该列表中进一步过滤对象,例如,通过使用getProperties方法获取单个对象的属性,或通过使用getBulkProperties方法一次请求多个对象的属性。

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.获得感兴趣的对象的 ID 后,您可以通过不同的方式突出显示它们,例如,使用select方法选择它们,或者使用隔离方法隐藏除这些对象之外的所有其他内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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