How to scope Tree Objects via ACT?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 389
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

How to scope Tree Objects via ACT?

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Answer ✓

    I couldn't find a direct property control value to enforce this, but one can use a workaround by setting the property to read only and scope the selected objects using an callback. The custom should be clicked (from the toolbar ribbon) after selecting the tree objects.

    XML:

    <property name="Selection" caption="Selection" control="selection" readonly="true">
        <callbacks>
            <onadd>ScopeSelectedEntities</onadd>
        </callbacks>
    </property>
    

    Python:

    def ScopeSelectedEntities(load, property):
        global my_property
        my_property = property
        property.Value = ExtAPI.DataModel.Tree.ActiveObjects