Printing the model tree#

To get an overview of an ACP model, you can print its tree structure. Starting with a Model instance:

>>> model
<Model with name 'ACP Model'>

You can print the tree structure using the print_model() function:

>>> pyacp.print_model(model)
Model
    Material Data
        Materials
            Structural Steel
        Fabrics
            Fabric.1
    Element Sets
        All_Elements
    Edge Sets
        ns_edge
    Geometry
    Rosettes
        Global Coordinate System
    Lookup Tables
    Selection Rules
    Oriented Selection Sets
        OrientedSelectionSet.1
    Modeling Groups
        ModelingGroup.1
            ModelingPly.1
                ProductionPly
                    P1L1__ModelingPly.1

Alternatively, you can use get_model_tree() to get a tree representation. This allows manually iterating over the tree structure:

>>> tree_root = pyacp.get_model_tree(model)
>>> tree_root.label
'Model'
>>> for child in tree_root.children:
...     print(child.label)
...
Material Data
Element Sets
Edge Sets
Geometry
Rosettes
Lookup Tables
Selection Rules
Oriented Selection Sets
Modeling Groups