Autodesk Forge:我创建了一个应用程序来转换CAD文件,但看不到装配体的属性 [英] Autodesk Forge: I created an app to translate CAD files, but cannot see properties for an assembly

本文介绍了Autodesk Forge:我创建了一个应用程序来转换CAD文件,但看不到装配体的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我创建了一个nodejs应用程序来转换CAD文件并在查看器中显示它们.对于.rvt文件和单个Inventor组件,我可以通过转到模型浏览器并单击每个组件来查看属性,但是,看不到整个Inventor装配体的属性.如何查看装配体属性?

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?

我正在使用此示例: https://github.com/Autodesk-Forge/viewer-walkthrough-online.viewer

仅将我所做的更改设置为CompressedUrn为true,并添加了rootFileName以允许翻译Inventor程序集.

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

推荐答案

有一个名为 modelBrowserExcludeRoot 的选项,您可以在创建查看器时将其设置为 false ..在这种情况下,该模型的根对象将在模型浏览器中可见,选择该模型后,您将在属性中看到装配的属性.调色板例如

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

这篇关于Autodesk Forge:我创建了一个应用程序来转换CAD文件,但看不到装配体的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆