autodesk-viewer

Download file from Autodesk Forge 3D viewer

被刻印的时光 ゝ 提交于 2019-12-24 11:24:56
问题 How do I download a file from the 3D viewer in Autodesk Forge. I am using 2 legged authorization and I am able to upload files to the bucket, but I am not sure how to download the file from them in the 3D viewer. The code below downloads files but there is nothing contained inside them: var element = document.createElement('a'); element.setAttribute('href', '#'); element.setAttribute('download', node.text); element.style.display = 'none'; document.body.appendChild(element); element.click();

Is there a way to get co-ordinates of the elements of a model?

岁酱吖の 提交于 2019-12-24 08:43:56
问题 For the purpose of comparing two models, is there a method or a function that i can use to get the co-ordinates out of elements of a model. 回答1: Unfortunately, Forge viewer doesn't play well with GIS information currently as I know. Apologizing for any inconvenience caused. However, you can use the following codes to disable the centralize behavior of the Forge Viewer (after v.3.1), if your Revit models are configurated with Revit shared coordinates system. Afterward, you models will be

Autodesk Forge Viewer - Getting different values dbId from “viewer.model.search” and “viewer.getSelection()”

萝らか妹 提交于 2019-12-24 08:09:25
问题 I'm trying to isolate some elements that I search with the method viewer.model.search but when I use the viewer.isolate method I get everything to hide. I already use the getSelection to isolate elements and I notice that they give me different dbId values for the same element. With getSelection dbId works but with the search doesn't Does that anyone have this same error? UPDATE 3/11/2019: While I was trying to figure out what happened, I realized that the search method gives you the number

Finding the centre point of the visible parts in the Autodesk Viewer

你说的曾经没有我的故事 提交于 2019-12-24 00:21:52
问题 Excuse the vagueness of this question, but in a model in the viewer, I'd like to know how I can establish the centre point of the visible parts. When I call fit-to-view on a model with hidden parts, I can see a dot appear in the viewer which seems to represent exactly this - the centre of the visible parts - how can I retrieve the coordinates of this point in code? 回答1: The little green dot represents the "target" of the camera. You can get its coordinates using viewer.navigation.getTarget()

How to resize on object - Autodesk Forge Viewer

会有一股神秘感。 提交于 2019-12-23 02:44:12
问题 How can i change size of on object ?? i need to change height of on object For example, we need to change the height of a door or curtain on this code my object disappears let change = function () { const viewer = oViewer; const model = viewer.model; const frags = [ 123, 361, ]; for(let i in frags){ let fragId = frags[i]; // Get mesh with frag id let mesh = viewer.impl.getRenderProxy(model, fragId); // Selection ID let dbId = 1280; // viewer.getSelection()[0] model.getData().instanceTree

How to Show/View or Read .dwg files on browser

本秂侑毒 提交于 2019-12-21 03:18:22
问题 How to Show or Read .dwg files on browser without using any software means using PHP, jQuery, Javascript or any other programming language. For this I have gone through https://developer.autodesk.com and created an app with Client ID and Client Secret, Also created index.html file. But after that i get stuck in finding next movement for getting required "Model Derivative API". So Please guide me for the same. Thanks for giving your precious response. <!-- The Viewer CSS --> <link rel=

Forge Viewer Select in a multi-model context

倖福魔咒の 提交于 2019-12-20 06:24:18
问题 We have extensions that currently leverage viewer.select() with a list of dbIds from the model. Our customers would like to see secondary models in the same viewer, and we’re giving them the ability to load reference models after the first model has been loaded. We’re running into a problem with multiple models, however, where the viewer is selecting from one of the models other than the first model loaded when we call viewer.select(). It seems like we may want to stop using viewer.select()

Forge Viewer THREE.MeshLambertMaterial

半世苍凉 提交于 2019-12-20 06:00:17
问题 One of the properties available on the var material = NEW THREE.MeshLambertMaterial is texture maps: {( map: new THREE.TextureLoader().load('wool.jpg') )} We're very curious whether it would be possible to load in a texture this way and apply it to a specific object in the model? 回答1: Yes, but the way you modify materials in the Forge Viewer is a little bit different than what you would do in Three.js. I have an extensive sample that illustrates how to modify materials, including custom

Decals not displaying in Autodesk Viewer

痴心易碎 提交于 2019-12-20 05:43:16
问题 When using the Autodesk Viewer, decals do not seem to display as expected. The image above has the decal displaying correctly (not rendered in Autodesk Viewer), and the image below has no decal (rendered in Autodesk viewer). Why is this so, and how can decals be made to work in Autodesk Viewer? Source files here. 回答1: Here is my code sample. I imported the STEP file on Forge, and copied the RefdFile_1.png file on my node.js server. var attenuationVertexShader =` varying vec2 vUv; varying vec3

Building Autodesk Forge RCDB on Windows 10 fails with node-gyp errors

一笑奈何 提交于 2019-12-20 05:01:54
问题 While attempting to get the Forge Responsive Connected Database to build. I am unable to build this application on my Windows 10 machine. I am unable to succesffuly run “npm install”. I get the following errors as listed below. I ended up trying to use a pre-configured “canvas” and it still didn’t let the node app run. https://github.com/Autodesk-Forge/forge-rcdb.nodejs I have tried these solutions to no success: https://github.com/npm/npm/issues/14543 https://github.com/nodejs/node-gyp#on