1. The official has the function of viewing the file tree, that is, the file tree of the model browser. What is the api for getting this file tree?
1. The official has the function of viewing the file tree, that is, the file tree of the model browser. What is the api for getting this file tree?
you can get the component tree in the following ways:
var it = viewer.model.getData().instanceTree;
//
viewer.getObjectTree(function( instanceTree ) {
console.log( instanceTree );
});
due to data optimization, all data are flattened. To reconstruct the data structure, you can use:
function buildModelTree( model ) {
//builds model tree recursively
function _buildModelTreeRec( node ) {
it.enumNodeChildren( node.dbId, function(childId) {
node.children = node.children || [];
var childNode = {
dbId: childId,
name: it.getNodeName( childId )
};
node.children.push( childNode );
_buildModelTreeRec( childNode );
});
}
//get model instance tree and root component
var it = model.getData().instanceTree;
var rootId = it.getRootId();
var rootNode = {
dbId: rootId,
name: it.getNodeName( rootId )
};
_buildModelTreeRec( rootNode );
return rootNode;
}
var root = buildModelTree( viewer.model );
when using three.js, use raycaster to select objects. If there is div occlusion on the upper layer of the canvas, the mouse can still select the model in the canvas. If you want to select a model that is not available when there is div occlusion, how to ...
the doors in the model are like the right side, and there are two modes of opening and closing at the same time. through the setting of the revit property, you can display open (left door), close and simultaneously open (right door) , but after importe...
Autodesk-forge model slightly how to load this model in IE browsers? at present, only advanced browsers such as Crome Google are supported ...
as shown in figure is the angle as shown in the picture? ...
found the method given by the teacher to draw custom lines, but the method seems to be to draw a frame for a single component, is there any way to frame multiple components? suppose my model as a whole is a building as follows and I just want to ...
A grid function needs to be added to the recent project. Refer to the grid effect done by others as follows: when the mouse hovers over a circle or a straight line, a label prompts : demothree.jsthis.viewer.impl.scenehtmlcanvas ...
I want to load the model locally. The model file is transferred to https: extract.autodesk.io. , it can be run on node.js, but failed to load on .net. The address of the file is not wrong, could you tell me what s going on? "` var initOptions = ...
if you want to customize the capture point of the model by customizing an extension instead of opening the measurement, how can you implement it? ...