autodesk-forge

Autodesk Forge Viewer How to get coordinates of line start/stop

故事扮演 提交于 2019-12-02 10:25:28
问题 I am trying to do room highlighting in forge viewer. In revit I have created lines that represent the borders of a room. After conversion to svf I know the dbids of those lines. Now I want to know the start and stop points (vertices) of those lines so that I can create a Three.Shape() of the room borders. [EDIT] I get the fragId from dbId function getFragIdFromDbId(viewer, dbid){ var returnValue; var it = viewer.model.getData().instanceTree; it.enumNodeFragments(dbid, function(fragId) {

How to upload obj with mtl and textures to bucket?

我只是一个虾纸丫 提交于 2019-12-02 10:00:42
As the title suggests, how do I upload the obj model's material file and textures, as they are hard coded in the obj file. Can I upload zipped dir structure or multiple files that are in correct relation (because of the hard coded nature of obj)? Here is an OBJ model with material and texture on the dotty trial site: http://trial.dotdotty.com/share/?shareId=cdc9-523f-305f-7ddb-5cc4 That was uploaded as a single zip file containing OBJ, MTL and PNG. Here is the same model on A360: http://a360.co/21rt4OK That was uploaded by selecting all three files and specifying the OBJ as the main model. A

PUT file data to a Autodesk API with Python Requests

a 夏天 提交于 2019-12-02 09:26:26
I am following the process described here but getting stopped by a 403 at Step 4. I have a token with data:write and data:create scopes as specified in the docs (and other API methods needing those scopes work) but I can't get a successful response and I think it's down to how I am sending the file data. My code looks like this: url = '{}oss/v2/buckets/{}/objects/{}'.format(self.DOMAIN, bucket_id, object_name) with open(file_path, 'rb') as f: file_content = f.read() response = self.session.put(url, data=file_content, headers={ 'content-type': 'application/octet-stream' } The auth token is

How to declare reference to an existing namespace which is available from javacript bundle at runtime

倾然丶 夕夏残阳落幕 提交于 2019-12-02 08:36:32
问题 I am writing a plugin for existing Javascript app - Forge Autodesk.Viewing After version 6 they have included THREE.js inside of their app bundle. Right now I'm able to use it with my plugin like this: declare var THREE:any; But I'm loose all types. So, I am install three.js by npm install --save three I'm able to use THREE, and import it. But I don't need to Import it as I already have it in my main app. What I need to do is to reference types. So, I tried to do something like this: declare

Default Navigation speed in Forge Viewer

怎甘沉沦 提交于 2019-12-02 08:27:11
问题 How can the default navigation speed be changed in the Forge Viewer? The default setting is far to fast for my sample models. I should like to write code so that the speed may be changed during a session. 回答1: Copy an existing navigation tool from the viewer3D.js implementation, modify the speed parameters as you wish or expose methods to do so dynamically from your app, then set it active. You can check the implementation of OrbitDollyPanTool L#14545 in viewer3D.js Autodesk.Viewing

How Autodesk Forge viewer manages multiple scenes to select multiple elements

可紊 提交于 2019-12-02 07:59:00
问题 I want to understand how Autodesk Forge viewer stores node elements in multiple THREE.Scene objects. There are several scenes: viewer.impl.scene // The main scene viewer.impl.overlayScenes // Three overlay scenes: selection, pivot and roll Whenever an element is selected in Forge viewer, its THREE.Mesh object is added to viewer.impl.overlayScenes.selection.scene.children. However its boundary geometry is always zero, unlike primitive THREE.Mesh objects will have boundaries after executing

Download a Document with Autodesk API

喜夏-厌秋 提交于 2019-12-02 07:51:59
问题 I'm trying to download documents from BIM 360 Docs. If I want to download a file with the type "type": "items:autodesk.bim360:File" I just need to get the bucketID and objectID ( /projects/<projectID>/items/<itemID> ) and call buckets/<bucketID>/objects/<ObjectID> . (I used this tutorial) But how do I download a file with the type "type": "items:autodesk.bim360:Document" ? First, I get the version of the document /projects/<projectID>/items/<itemID>/versions . After that I call projects/

How properties.db is used in Forge Viewer?

狂风中的少年 提交于 2019-12-02 07:14:26
问题 The sqlite database file properties.db is usually the biggest file in the output from https://extract.autodesk.io/. What is it used for in Forge Viewer, and if it's not used, why is it available in the ZIP file? 回答1: The reason this example is copying both is that the purpose of the sample is to demo how to extract the 'bubble' from the Autodesk server. The Design File' properties are extracted in 2 formats: aka json (json.gz) and sqlLite (sdb/db). The Autodesk Viewer only uses the json

setThemingColor only working for leaf node dbIds

回眸只為那壹抹淺笑 提交于 2019-12-02 05:21:11
From the documentation it looks like you should be able to call setThemingColor with any dbId, but it seems to only work if the id that you pass is a leafnode? Is this correct? Also is there any way to bulk call this method, or is it only one single leaf node at a time? I would like to pass an array of dbId's into the method. Yes, it's only working with the leaf nodes in my experience. However, leaf nodes of a parent node can be retrieved in this way: getLeafNodes( model, dbIds ) { return new Promise( ( resolve, reject ) => { try { const instanceTree = model.getData().instanceTree dbIds =

How to Retrieve Forge Viewer objectTree?

丶灬走出姿态 提交于 2019-12-02 05:15:16
问题 My goal is to highlight a room by adding new geometry to the viewer based on lines I have created in revit like they do here Link but i can not figure out how to access those lines ids. I know what they are in revit (element_id) but not how they are mapped as dbid. Following this Blog Post I want to access the objectTree in my extension to find out, but it always comes back as undefined. var tree; //old way - viewer is your viewer object - undefined viewer.getObjectTree(function (objTree) {