2017-08-21 38 views

回答

1

屬性組中未命名爲鍛造廠觀衆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

希望這有助於。

+0

謝謝@Eason Kang。這段代碼幫了我很多。 –