javascript - How to access/highlight a polyline in Autodesk Viewer -


using autodesk forge viewer

two questions

first

i have converted dwg svf file. want able highlight polyline when click on mouse. can give me pointers on how this. can not figure out how access getmaterials.highlightobject2d if indeed supposed use.

second

assuming first possible. there way see dwgs object_handles after drawing converted. want "highlight" specific polylines

for #1, can use .select():

_viewer.select(dbids); 

or maybe can change color this:

function color(dbid, color) {     var elementids = [dbid];     _viewer.setcolormaterial(elementids, parseint(color/*hex color*/, 16)); } 

for #2, can iterate through properties this:

function findproperty(dbid) {     _viewer.model.getproperties(dbid, function (props) {         props.properties.foreach(function (prop) {             if (prop.displayname === 'handle') {                 //             }         });     }); } 

but you'll need iterate through elements, check sample on how properties on model (this sample creates pie chart).


Comments