How to open (activate) a group via the ruby API

I see there’s Model#close_active, but can’t find the equivalent for opening a group

It is not possible to open a “container” via the API.

BUT if you want to add geometry etc into a ‘container’, then just get a reference to say:

ents = group.entities

and the add the new stuff to that context…

Why do you want to open a container ?

2 Likes

The concept of a Group or Component being “open for edit” or the “active context” comes purely from the GUI, where a user needs to access a Group or Component’s Entities to manipulate them. Are you trying to program something that will make a particular Group or Component active and then turn over control for the user to edit it via the GUI? Otherwise, as @TIG pointed out, your Ruby code can directly access the Entities collection of any Group or ComponentDefinition regardless of what is active in the GUI.

2 Likes

This topic was automatically closed after 91 days. New replies are no longer allowed.