1. How to get the currently selected artifact or the currently selected build set
2
3
1. How to get the currently selected artifact or the currently selected build set
2
3
//
viewer.getSelection();
//
var onSelectionChanged = function( event ) {
console.log( event.dbIdArray );
};
viewer.addEventListener(
Autodesk.Viewing.SELECTION_CHANGED_EVENT,
onSelectionChanged
);
2. Get the properties of the selected component
//
var onPropsFeteched = function( result ) {
console.log( result.properties );
}
var onFetchingPropsFailed = function( error, message ) {
console.error( error, message );
}
viewer.getProperties(
dbId,
onPropsFeteched,
onFetchingPropsFailed
);
// dbId
// https://forge.autodesk.com/blog/getbulkproperties-method
viewer.model.getBulkProperties( dbIds, [''],
function( elements ) {
for(var i=0; i<elements.length; iPP){
console.log( elements[i].properties[0] ;
}
});
//
// https://segmentfault.com/a/1190000010977818
viewer.search(
"",
function( dbIds ) {
console.log( dbIds );
},
[""]
);
3. Add component properties
your title seems to be inconsistent with the text. Let me first answer the question of the title. The model and attributes of Forge transformation cannot be modified, so they cannot be added, or your own properties https://codeshelper.com/a/11.
as for adding icons in the text, you can refer to these examples:
Markup 3D
in the menu on the right.
P.S. It is recommended to find the sample https://github.com/Autodesk-F.
.how to add icons to widgets
Previous: Webpack introduces config
1. Get the TransformGizmos of the model movement 2.GIZMO 3.gizmo ask for answers or provide ideas for the generation of gizmo objects and matters needing attention in calling. ...