autodesk-forge

Forge Viewer Extension for Toolbar: How to add a custom combox

╄→гoц情女王★ 提交于 2021-02-11 12:29:34
问题 I am trying to add a custom combobox to the toolbar in the forge viewer. Below is the code for it. I am able to successfully able to add buttons and they are functional. But combobox is not. It adds a combobox but it does show the fly out menu when I click on it. Not sure what I am doing wrong. help! function BuildingToolbarExtension(viewer, options) { Autodesk.Viewing.Extension.call(this, viewer, options); } BuildingToolbarExtension.prototype = Object.create(Autodesk.Viewing.Extension

How do I display a thumbnail that has been generated after translation

不问归期 提交于 2021-02-11 07:00:09
问题 After translating a file to SVF I can see that there is thumbnails that have been generated. How do I use the URN to display these thumbnails? Thanks! 回答1: You can use the Thumbnail endpoint to download the picture, but it requires the Token. So you can, for instance, download it on your server-side (with the token) and redirect the stream to the client-side (from your server). Here is the thumbnail endpoint: '/modelderivative/' + MD_PROJECT_VERSION + '/designdata/' + urn + '/thumbnail?width

Forge tool handleButtonDown and handleButtonUp functions not getting called

倖福魔咒の 提交于 2021-02-10 19:54:58
问题 I was looking at the sample code for the tutorial at https://forge.autodesk.com/blog/custom-window-selection-forge-viewer-part-iii which is located at https://github.com/Autodesk-Forge/forge-rcdb.nodejs/blob/master/src/client/viewer.components/Viewer.Extensions.Dynamic/Viewing.Extension.SelectionWindow/Viewing.Extension.SelectionWindow.Tool.js as well as the documentation at https://developer.autodesk.com/en/docs/viewer/v2/reference/javascript/toolinterface/ --- Most of these functions are

Forge tool handleButtonDown and handleButtonUp functions not getting called

扶醉桌前 提交于 2021-02-10 19:53:57
问题 I was looking at the sample code for the tutorial at https://forge.autodesk.com/blog/custom-window-selection-forge-viewer-part-iii which is located at https://github.com/Autodesk-Forge/forge-rcdb.nodejs/blob/master/src/client/viewer.components/Viewer.Extensions.Dynamic/Viewing.Extension.SelectionWindow/Viewing.Extension.SelectionWindow.Tool.js as well as the documentation at https://developer.autodesk.com/en/docs/viewer/v2/reference/javascript/toolinterface/ --- Most of these functions are

How to set opacity of each nodes

风格不统一 提交于 2021-02-10 14:21:17
问题 Is there anyway to set opacity of some nodes of the model? For instance, create a override material and use it in renderer for some nodes rather than whole scene. 回答1: When loading a model, the viewer builds its internal spatial indexing structures (BVHs), and one of the factors it takes into account is the transparency of the different fragments. This is in order to ensure that semi-transparent objects are rendered after the opaque ones. However, when changing the material of a fragment on

How to set opacity of each nodes

好久不见. 提交于 2021-02-10 14:21:06
问题 Is there anyway to set opacity of some nodes of the model? For instance, create a override material and use it in renderer for some nodes rather than whole scene. 回答1: When loading a model, the viewer builds its internal spatial indexing structures (BVHs), and one of the factors it takes into account is the transparency of the different fragments. This is in order to ensure that semi-transparent objects are rendered after the opaque ones. However, when changing the material of a fragment on

Getting Forge 2-legged authentication using Cross request

让人想犯罪 __ 提交于 2021-02-10 06:42:13
问题 I'm trying to create a simple html page to display a uploaded model to forge. For initialize the forge viewer it required the access-token. For request the access token I'm using the 2-legged oAuth on a Cross request(because I'm making the POST on different domain).But it keep getting error "No 'Access-Control-Allow-Origin' header is present on the requested resource". Please some one can tell me what should I do to get the acces-token successfully. 回答1: As you noticed, you cannot obtain a

Getting Forge 2-legged authentication using Cross request

落花浮王杯 提交于 2021-02-10 06:39:05
问题 I'm trying to create a simple html page to display a uploaded model to forge. For initialize the forge viewer it required the access-token. For request the access token I'm using the 2-legged oAuth on a Cross request(because I'm making the POST on different domain).But it keep getting error "No 'Access-Control-Allow-Origin' header is present on the requested resource". Please some one can tell me what should I do to get the acces-token successfully. 回答1: As you noticed, you cannot obtain a

Autodesk forge viewer zooming to bounding box

徘徊边缘 提交于 2021-02-05 10:49:27
问题 I have a bounding box object as below: bb = { "min": { "x": -6.637446403503418, "y": -19.579801559448242, "z": -0.22575747966766357 }, "max": { "x": 10.237555503845215, "y": 19.15947914123535, "z": 9.774243354797363 } } I want to zoom to this bounding box and make camera as centre. 回答1: You can simply call viewer.navigation.fitBounds( immediate, bounds ) to do this. The first argument, immediate , means that camera position will animate to the new location if immediate is set as false. The

How to use user defined font on Forge design automation with AutoCAD Plot API

痴心易碎 提交于 2021-02-05 09:34:26
问题 We are using the Forge Plot API to plot DWGs to PDF/JPG. A customer came up with DWGs that are using a special TTF-Font called ROBBI.TTF. I suppose this font has to be uploaded to the Forge server before it can be used. Is it possible to upload the font once, so that it can be used for all our plot jobs? If not: What is the best way to plot using a custom TTF font? 回答1: Thomas, yes, you can wrap custom fonts in your apppackage bundle under Contents folder and refer the path to SupportPath