【问题标题】:How to copy the functionality of the model browser?如何复制模型浏览器的功能?
【发布时间】:2019-04-19 20:50:50
【问题描述】:

在项目侧边栏中,我显示了模型所包含的所有元素。

现在我需要让这个列表的功能类似于在模型浏览器上按下按钮后触发的功能。

特别是,当我单击我创建的侧边栏列表中的一项时,我需要它会将我重定向到我单击的元素,就像使用模型浏览器时所做的那样。

【问题讨论】:

    标签: autodesk-viewer


    【解决方案1】:

    您需要对点击事件做出反应,我假设您已经设置好了。然后执行这段代码:

    function (dbIds, model) {
        // dbIds can be either an array of dbId (int), or a single dbId (int)
        // model is the model object to which dbId belongs to
        if ( dbIds === -1 || (Array.isArray(dbIds) && dbIds.length === 0 ) {
            viewer.select([], undefined, model);
        } else {
            viewer.select(dbIds, model);
            viewer.fitToView([dbIds], model, false);
        }
    }
    

    【讨论】:

    • 非常感谢您的帮助,确实帮助解决了
    猜你喜欢
    • 2013-01-26
    • 2012-01-20
    • 1970-01-01
    • 2012-08-26
    • 1970-01-01
    • 1970-01-01
    • 2013-10-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多