簡體   English   中英

如何在Autodesk Forge中獲取屬性組名稱

[英]How to get the properties group names in autodesk forge

我想知道有什么方法可以在Autodesk Forge中獲得屬性組名稱。 我曾嘗試使用getProperties()getBulkProperties()但無法獲取組名。 如何實現這一目標。 提前致謝。

我只需要突出顯示組名

在Forge查看器中,屬性組未命名為group 在這種情況下,它稱為category ,可以通過displayCategory進行訪問。 這是一個例子:

var selection = viewer.getSelection();
viewer.getProperties( selection[0], function( result ) {
    const props = result.properties;
    for( let i = 0; i < props .length; i++ ) {
        const property = props[i];
        if( property.hidden) return;

        const category = props[i].displayCategory;
        if( category && typeof category === 'string' && category !== '' ) {
            // The property group you want
            console.log( category );
        }
    }
});

順便說一句,您可以從此博客中查看更多詳細信息: https : //forge.autodesk.com/cloud_and_mobile/2015/05/adding-custom-meta-properties-to-the-viewer-property-panel.html

希望對您有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM