Reputation: 616
I'm using the viewer on an Angular app. I want to console.log
the properties of the selected object.
Reading through the documentation, I found the getProperties
function. The documentation says it raises a onPropertiesReady
event, however I can't find it on the EVENTS section of the documentation. Am I missing something here?
Thank you very much.
Upvotes: 0
Views: 147
Reputation: 4375
The event you need to wait for to make sure the properties have been loaded is Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT
. Take a look at this article: Event Watcher
To listen for user selection, you need to use Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT
which returns an array of dbIds in the arguments that you can pass to viewer.getProperties(dbId, callback)
Hope that helps
Upvotes: 2