Reputation: 35
I'm creating geometries using code from https://forge.autodesk.com/blog/custom-models-forge-viewer. When selecting custom geometries with selection mode FIRST_OBJECT, AGGREGATE_SELECTION_CHANGED_EVENT is fired with a dbId of -1000000000.
Changing selection mode to LEAF_OBJECT is not an option because FIRST_OBJECT-mode is used for other reasons. Is it possible to use FIRST_OBJECT-mode and still get the correct DBID for custom geometries?
Upvotes: 0
Views: 52
Reputation: 9934
Thank you for the heads up. Yes, when a custom model is created, i.e., it's just a single root node element referencing a flat list of geometries. The dbid of the root node is set to -1e9, and its type is set to NODE_TYPE_ASSEMBLY (0x0)
, which is why the selection was behaving in an unexpected way when using the selection mode FIRST_OBJECT
.
What's strange is that the type of the root node should be set to NODE_TYPE_MODEL (0x5)
instead. I will report this to the engineering team, and in the meantime, you can set the NODE_TYPE_MODEL
type to the root node manually to work around this issue.
Upvotes: 1