Hi Kondou, you can access the scene browser object model using moi.ui.sceneBrowser. The sceneBrowser object has 4 properties:
sceneBrowser.objects - list of all the items for the "Objects" section of the scene browser.
sceneBrowser.types - list of all the items for the "Types" section of the scene browser.
sceneBrowser.styles - list of all the items for the "Styles" section of the scene browser.
sceneBrowser.rootItems - all root elements currently will include objects, types and styles combined. In the future there may be more.
Each scene browser item object has the following:
item.name - read-only string for item name.
item.expandable - read-only bool for whether the item is expandable.
item.expanded - bool for whether item is currently expanded or collapsed.
item.parent - parent item
item.children - list of child items
item.find( 'name' ) - function that will recursively search for a child item of the given name.
item.alterStatus( 'show', false ) - function that will perform actions on the item same as if it was clicked on the status icon (the eye on the left side).
Param 0 = one of 'show', 'hide', 'lock', 'unlock', default if not given is 'show'.
Param 1 = true for right click behavior.
item.select( 'toggle', false ); - function that will perform actions on the item same as if it was clicked on the selection indicator dot (on the right side):
Param 0 = Param 0 = one of 'toggle', 'select', 'deselect', 'filteron', 'filteroff'. Default if not given is 'toggle'.
Param 1 = true for right click behavior.
Currently style colors are not accessible through here, but you can get a list of object styles using moi.geometryDatabase.getObjectStyles(), see EditStyleDialog.htm for an example.
- Michael
|