Autodesk forge 突出显示子对象 [英] Autodesk forge highlight child object

查看:19
本文介绍了Autodesk forge 突出显示子对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在研究这个存储库https://github.com/xiaodongliang/forgeviewer_embed_in_powerbi_report 在 Power BI 中构建自定义视觉对象,以可视化从 Bim track 的 API 中提取的问题.

Recently i've been working on this repository https://github.com/xiaodongliang/forgeviewer_embed_in_powerbi_report to build a custom visual in Power BI to visualize the issues extracted from Bim track'S API.

这个想法是将它们与模型的房间关联起来进行可视化.为此,我使用了 NWC 文件,因此我将房间导出为几何图形.

The idea was visualizing them in associaton to the model's ROOMS. In order to do that I worked with a NWC file, so i cuold export rooms as a geometry.

如果从表格中选择了连接的问题,我现在想做的是突出显示房间.问题是当我从表中选择一个问题时,在选择树中我可以看到突出显示的父对象名称(ROOM)而不是子对象(实心),我认为这就是为什么我无法实现我的目的(如果不请指正).

What i would like to do now is to highligt the rooms if a connected issue is selected from a table. The problem is When i select an issue from a table, in the selection tree i can see highlighted the parent object name (ROOM) instead of the child (solid), and i think that is why i can't achieve my purpose (if not please correct me).

我有什么

我想做的事

有人知道怎么做吗?

推荐答案

如果我理解得很好,你想突出显示子项(包含网格)而不是父项.

If I well understood, you want to highlight the child (which contain the mesh) instead of the parent.

对象突出显示(隔离)在 /forgePowerbiView/src/visual.ts 中使用以下代码完成:

The object highlight (isolate) is done in /forgePowerbiView/src/visual.ts with this code:

const dbIds = options.dataViews[0].table.rows.map(r => 
                <number>r[0].valueOf());
console.log('dbIds: '  +dbIds)
        
this.forge_viewer.showAll();
this.forge_viewer.impl.setGhostingBrightness(true); //for isolate effect 
this.forge_viewer.isolate(dbIds);

看看这个链接枚举查看器上的叶节点.这将帮助您获得要隔离的 dbIds.

Take a look at this link Enumerating leaf nodes on Viewer. This will help you to get the dbIds you want to isolate.

这篇关于Autodesk forge 突出显示子对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆