About SceneBrowser more API infomation

Next
 From:  Kondou
10482.1 
drar All or Michael:

can tell me more about sceneBrowser.objects, sceneBrowser.types, and sceneBrowser.styles API infomation?

how to get sceneBrowser.objects, sceneBrowser.types, sceneBrowser.styles inside items infomation.

exp: object.items.name, .styles.items.color and more SceneBrowser attributes.

Thank you!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10482.2 In reply to 10482.1 
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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Kondou
10482.3 In reply to 10482.2 
Michael Thank you! for your detailed response. It helped me a lot.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All