autodesk-viewer

Autodesk Forge viewer renders only single page for PDF files

风格不统一 提交于 2019-12-31 03:51:08
问题 In our application we're using Autodesk Forge Viewer to render 3D and 2D design files. Files with other formats get rendered pretty well. But in case of the pdf files, only the first page gets rendered even if the file actually has multiple pages. But we need to display all the pages . Here's the part of code I'm using to initialize the viewer: function doInitializeTheViewer(urn, token, element) { const options = { 'env': 'AutodeskProduction', 'accessToken': token }; let documentId = 'urn:' +

Download all the derivatives for the purpose of the using Forge Viewer offline/C#

最后都变了- 提交于 2019-12-25 18:42:18
问题 refering to this post ,I know there is a way to download the tranlated files with node.js" How do I download SVG/SVF for offline viewing with Autodesk Model Forge APIs",and using the Model Derivative api "GET :urn/manifest/:derivativeurn", I can download all the files record in manifest, download files pic: http://imgur.com/iPFn3Cx my question is :are these files I download from manifest with "GET :urn/manifest/:derivativeurn" enough for offline viewing? If not,did anyone implement this

Download all the derivatives for the purpose of the using Forge Viewer offline/C#

空扰寡人 提交于 2019-12-25 18:42:14
问题 refering to this post ,I know there is a way to download the tranlated files with node.js" How do I download SVG/SVF for offline viewing with Autodesk Model Forge APIs",and using the Model Derivative api "GET :urn/manifest/:derivativeurn", I can download all the files record in manifest, download files pic: http://imgur.com/iPFn3Cx my question is :are these files I download from manifest with "GET :urn/manifest/:derivativeurn" enough for offline viewing? If not,did anyone implement this

How to get a list of dbids contained in a layer?

喜欢而已 提交于 2019-12-25 18:20:41
问题 I am trying to access the list of objects or dbids contained with a layer of a 2d model. Ideas? Thank you. 回答1: After checking with our dev team, it might be not possible to get a list of dbIds for a layer currently unfortunately. The implementation of the 2D model is not the same as the 3D model. 来源: https://stackoverflow.com/questions/46517341/how-to-get-a-list-of-dbids-contained-in-a-layer

Change material of hidden elements of Autodesk Forge viewer

ⅰ亾dé卋堺 提交于 2019-12-25 16:47:24
问题 I would like to change material (THREE.MeshPhongMaterial) of elements which were hidden by the viewer. The default hidden elements are still visible, but I want to change their transparency and color. Here is the example code. I tried to change both theming color and material but no success: viewer.hideById(dbId); var color = 0x0000ff; // blue color viewer.setThemingColor(dbId, color, viewer.model); var instanceTree = viewer.model.getData().instanceTree; var fragmentList = viewer.model

Controlling camera in Forge viewer

时光毁灭记忆、已成空白 提交于 2019-12-25 08:49:24
问题 I'm trying to control the camera in the Autodesk Forge Viewer. Setting target and position seems to work fine, but if I try to set rotation or quaternion it do not have any effect. To get the camera I use the getCamera function and then applyCamera after I have tried to set the parameters. What I'm trying to achieve is to use the device orientation on a handheld device to rotate the model. Just using alpha and beta to set target is not a smooth experience. // get camera var cam = _viewer

Autodesk Forge: Measurement and Slice not working - Not an instance of THREE.Object3D

旧时模样 提交于 2019-12-25 01:12:18
问题 I have created a Forge Viewer using version 7 of the viewer3d.js and can view a model within it. My issue is that the measurement and slice tools aren't working as expected. FYI I'm using typescript - angular 8. I'm expecting the graphics to look like this for a slice: Instead the plane and gyroscope symbol never appear: Similarly with the measurement tool, the mouse cursor changes to the measurement cursor, but when i click on a surface, nothing happens. Here is my code for loading the

How do can I load model and change materials before showing it in the Forge Viewer

主宰稳场 提交于 2019-12-25 00:18:03
问题 I want to be able to show a model in the forge viewer but before the model shows I need to change the materials from its defaults. Currently I register the Autodesk.Viewing.GEOMETRY_LOADED_EVENT and when I receive the event I hide the model, change the materials and then show the model. This works except that the default model displays in the viewer for a second or two before I can hide it. How can I prevent that from happening? After initializing the viewer here is code that loads the

Get a list of all objects from loaded model

邮差的信 提交于 2019-12-25 00:15:57
问题 I need to get all the properties from all the objects in the currently loaded model. If I have a list of all the dbIds, I can use the Autodesk.Viewing.Viewer3D.getProperties(dbid,onSuccessCallback,onErrorCallback) method to retrieve them. Is there a way to get a list of the dbIds of all the objects in the viewer? Or is there a better way to achieve this? 回答1: Here is how you can get all the dbIds in the model: Get all database id's in the model Now we also have a function to retrieve

Loading IconMarkupExtension

被刻印的时光 ゝ 提交于 2019-12-24 18:55:22
问题 Trying to add labels with text on top of the objects in 3D viewer. I found the following post about an extension that does this: https://twitter.com/augustomaia/status/1205652823733460993 viewer.loadExtension('IconMarkupExtension', { icons: [ { dbId: 987,label: '300C',css:'fas fa-thermometer' } ] }); Loading this extension, produces the following error: "Extension not found: IconMarkupExtension. Has it been registered?" Is this part of the official Extensions? Or is there similar