Autodesk Forge: I created an app to translate CAD files, but cannot see properties for an assembly

烂漫一生 提交于 2021-02-11 14:19:31

问题


So I created a nodejs app to translate CAD files and to display them in the viewer. For .rvt files and individual Inventor components I can see the properties by going to Model Browser and clicking on each component, however, I cannot see properties for an entire Inventor assembly. How can I go about seeing assembly properties?

I am using this sample: https://github.com/Autodesk-Forge/viewer-walkthrough-online.viewer

Only change I made was set compressedUrn to true and added a rootFileName to allow Inventor assemblies to be translated.


回答1:


There is an option called modelBrowserExcludeRoot that you can set to false when creating the Viewer. In that case, the root object of the model will be visible in the Model browser and when selecting it you'll see the properties of the assembly in the Properties palette e.g.

Autodesk.Viewing.Initializer(options, () => {
  viewer = new Autodesk.Viewing.GuiViewer3D(
    document.getElementById('forgeViewer'), 
    { 
      modelBrowserExcludeRoot: false 
    }
  );
  viewer.start();
  var documentId = 'bubble.json'; 
  Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
});

Also have written a blog post about it just now: Root object not visible in Model browser



来源:https://stackoverflow.com/questions/65080853/autodesk-forge-i-created-an-app-to-translate-cad-files-but-cannot-see-properti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!