问题
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