autodesk-viewer

persistence of externalId Navisworks files

点点圈 提交于 2019-12-13 02:07:07
问题 I've been using the externalId to uniquely refer to objects in the forge viewer and connect them with outside data about these objects. This has worked well for revit files, which have a kind of GUID 86715290-fa28-4ff5-aef9-8c75d7c81e77-0012917b . Now I'm working with a Navisworks file, and their externalId use looks very different with values like a , 0 or 0/0/0/ . How persistent are these, I can imagine not globally unique, but do changes/removals/additions keep them unique within the file?

Determine if node is an assembly or part in viewer

孤人 提交于 2019-12-12 04:45:08
问题 I am looking to determine if a node is an assembly or a part. I have looked through the viewer3D.js code and came across the below flags: Although when I work access these flags, the result is always 0 for all nodes regardless whether it is a GEOMETRY, COMPOSITE OR ASSEMBLY. Are these flags currently in use? Or are they legacy code that is no longer being used? 回答1: You can simply check if the node has children or not. Only leaf nodes have geometry. I don't know of a more direct way to do

How to create a Docking Panel

坚强是说给别人听的谎言 提交于 2019-12-12 04:23:48
问题 How to create a docking panel? I am using the code from the example https://developer.autodesk.com/en/docs/viewer/v2/reference/javascript/dockingpanel/ that should inherit and override needed methods. SimplePanel = function(parentContainer, id, title, content, x, y) { this.content = content; Autodesk.Viewing.UI.DockingPanel.call(this, parentContainer, id, ''); // Auto-fit to the content and don't allow resize. Position at the coordinates given. // this.container.style.height = "auto"; this

Load multiple URN in a same Viewer

匆匆过客 提交于 2019-12-12 04:07:16
问题 How to load multiple URN or and array of URN in a viewer and also use the GlobalOffest of the 1st URN to load the 2nd URN in same viewer 回答1: It's simple, the basic scenario is from this official blog's loadModel function. You can load 2nd model while Autodesk.Viewing.GEOMETRY_LOADED_EVENT was fired and apply 1st model's GlobalOffest to the 2nd model in my experience. Here is the example for this case: function _onGeometryLoaded( event ) { if( urns.length <= 0 ) { viewer.removeEventListener(

Autodesk Forge Viewer : f2d get frag from dbid

岁酱吖の 提交于 2019-12-12 02:46:54
问题 I am trying to fill in room with color on a revit converted file's 2d viewer. I have a Revit file that has "rooms" defined. The Revit file also has sheets defined "Floor one", "Floor two". When I convert it using the Forge API I get a svf for the Revit 3D view and f2d files for "Floor one" and "Floor Two" sheets. For the svf I was able to get fragid from dbids other post Now Im trying to do the same for the f2d files. I am able to change the color of the room walls if I know the wall shapes

How to get location with dbid in 2D

风格不统一 提交于 2019-12-12 01:26:54
问题 How can I get location (x and y) of object with dbid in 2D viewer? What about properties of object with dbid? The format of the 2D file is dwg. 回答1: What about properties of object with dbid? You can use getSelection() method followed by getProperties(dbid, onSuccessCallback, onErrorCallback) which Gets the properties for an ID. Once the properties are returned, the method raises a onPropertiesReady event. You can check the Documentation here. https://developer.autodesk.com/en/docs/viewer/v2

Forge Viewer - Custom background image

心不动则不痛 提交于 2019-12-11 19:35:35
问题 My understanding is that we can add custom skyboxes to the viewer. As of now I am also aware the feature that changes background color and gradient. However, is it possible to add a custom background image? This would've been really helpful in our scenario. 回答1: As I know, if your models are translated from Inventor, and you had set custom background up before uploading, then you can see the user-defined background shows up in the Forge Viewer. In contrast, your models are from another

How to change object names in Forge Viewer?

主宰稳场 提交于 2019-12-11 18:10:47
问题 How can I change the names of objects and parent nodes in Forge Viewer? In version 6.1 and below, there was a blog post that worked: by altering the ModelStructureTreeDelegate class, reloading it as an extension, effectively overriding it. That doesn't work on 6.2 and later (current is 6.3.3), because now that class is not accessible anymore, or otherwise doesn't work. What I found was that, by accessing the InstanceTreeStorage.prototype.processName method, I could change the name of objects

Autodesk Forge Extension

狂风中的少年 提交于 2019-12-11 17:37:09
问题 So I am following this tutorial to extend the autodesk forge viewer. I have compelted all of the steps and no button is showing, I assume this is due to an error with the loading. https://forge.autodesk.com/blog/extension-skeleton-toolbar-docking-panel I have also tried this tutorial, with the same issue: http://learnforge.autodesk.io/#/viewer/extensions/selection?id=conclusion My issue is I am not getting an error, the extension just isn't showing... does anyone know why? I'm assuming theres

How to convert viewer coordinates back to CAD coordinates?

笑着哭i 提交于 2019-12-11 17:19:50
问题 I am trying to convert from the viewer (scene) coordinates back to the original CAD coordinates. I have seen people mentioning the global offset, but whenever I try to retrieve this, I get undefined. I assumed this means there is no offset. But when I compare two coordinates one in the viewer and one in CAD, they are definitely not equal. I came across the function NOP_VIEWER.model.getUnitScale() ; however, this number did not seem to mean anything when applying it to the coordinates. That