Open sannysoni123 opened 6 years ago
This would be cool. I've found very limited access to what happens in the model browser (some example of how to switch the event a click on the model browser leaves would fire, for example). But it would be much nicer if you had a way to get a reference to the instance to, for example, change the handler function that responds to the mouse clicks.
In fact, based on this post and after some console.log
's, I've found out what you have to override to have a little bit of control. In the current version of Viewer I'm using (v7), a click on an item in the Viewer Model Browser fires an internal function that isolates the clicked element. This internal function is called isolate
. Without having to mess with everything, you can override it:
(Autodesk.Viewing.Extensions as any).ViewerModelStructurePanel.prototype.isolate = function isolate(
dbId: number,
model: Autodesk.Viewing.Model
) {
// here you can do whatever you want to
if (model) {
const event = {
type: 'MY_CUSTOM_EVENT',
dbId,
model,
};
this.viewer.dispatchEvent(event);
}
};
i used headless functionality for viewer in angular 5. Common attributes like zoom, rotation, pan - custom usage of setActiveNavigationTool() inbuilt function. so is there any way to get model browser data functionality like door / wall / kitchen attributes Please let me know the way ...