> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Model classes

## `Model` class

#### *class* compolyx.Model(name=None, path=None, format=None, ignored\_entities=None, graph=None, parent=None, convert\_section\_data=False, unit\_system\_type=None, reference\_surface\_input\_unit\_system\_type=None, cache\_data=False)

Class to represent a finite element model.

* **Access:**

```python theme={null}
>>> import compolyx
>>> db = compolyx.DB()
>>> model = db.import_model(name='class40.1', path='class40.cdb', format='ansys:cdb')
```

* **Get existing model:**

```python theme={null}
>>> class40_model = db.models['class40.1']
```

#### *property* active\_scene

Active Scene.

#### add\_solution(name, id='', path=None, path2=None, format='ansys:rst', subcase=(False, 0), set=-1, load\_factor=(False, 0.0), read\_stresses\_strains=True, use\_felyx\_to\_compute\_pp\_results=True, use\_solid\_results=True, recompute\_iss\_of\_solids=False, renumbering\_mapping\_paths=\[], ext\_id='', active=True)

Load a nodal solution from file(s) and add it to the model.

* **Parameters:**
  * **name**: Custom name of the solution.
  * **path**: Path to the data file.
  * **path2**: Optional path to second result file. Useful for ANSYS PRNSOL solution, where nodal deformations and nodal rotations can be exported to different files only.
  * **format**: File format string. Options:
    * `abaqus:fieldreport`
    * `ansys:prnsol`
    * `ansys:rst`
    * `nastran:f06`
  * **subcase**: Optional subcase to read. Only supported for `nastran:f06` format. (False,0) if not given in the F06 file.
  * **load\_factor**: Optional load factor within substep of non-linear solution where the nodal solution should be taken from. Only supported for `nastran:f06` format. (False,0) if not given in the F06 file.
  * **set**: Result set for ANSYS RST files, None is last result set.
  * **read\_stresses\_strains**: Reads strain and stress results from the RST file (necessary to postprocess non-linear solutions).
  * **use\_felyx\_to\_compute\_pp\_results**: Use ACP to compute strain and stress data.
  * **use\_solid\_results**: Maps solid element solution onto Layered Solid Reference Surface.
  * **recompute\_iss\_of\_solids**: For solids the interlaminar shear stresses are recalculated considering the laminate stacking.
  * **renumbering\_mapping\_paths**: List of paths of the assembly renumbering files used to map the results of composite assemblies.
  * **active**: Active/inactive flag.
* **Returns:**
  The new Solution instance just added to the model.

#### add\_winding\_entities(axial\_direction, origin, reference\_radius, layers, max\_angle\_with\_thickness\_correction=90.0, number\_of\_digits\_angle=3)

Generates a winding layup for an axisymmetric body.

The function uses the origin (a point on the axis of symmtery),
the axial\_direction, and the reference radius
to automatically generate a winding layup for an axisymmetric body.
The radius is defined as the minimal distance from any point on the surface
to the axis of symmetry. The reference radius is equal to the radius, where
the layers have the nominal thickness and angle. For a typical winding body, this is
the radius in the cylindrical region.

The thickness correction of each layer is calculated with:
thickness\_correction = reference\_radius / radius

The angle is calculated based on a geodesic path for which radius\*sin(angle) is constant:
angle = arcsin( const / radius) if const / radius in \[-1,1]
angle = sign(angle) \* 90° otherwise

with const = reference\_radius \* sin(nominal\_angle)

Each layer is a dict with the following properties:

* **fabric**: Fabric of the layer (Stackups and Sublaminates are not supported).
* **angle**: Nominal angle at Reference Radius with respect to the axis of symmetry (in degree).
* **selection\_rule\_limits**: A dictionary with the entries "upper” and “lower”
  that define the extent of the plies in axial direction.
  The “upper” and “lower” values are interpreted as distance from the origin along
  the axial\_direction.
* **add\_mirrored\_ply**: If true, an addtional layer with the same properties but
  a negative angle is generated. This implies that the resulting thickness is
  twice the original thickness of the layer.

The function generates the following objects:

* A cylindrical rosette.
* An oriented selection set which defines a reference direction along the axial
  direction of the axisymmetric body.
* A lookup table with the thickness corrections and angles.
* A template selection rule if limits are defined.
* A modeling group with the plies.

- **Parameters:**
  * **axial\_direction**: Direction vector for the axis of symmetry.
  * **origin**: Point on the axis of symmetry.
  * **reference radius**: Reference radius at which the plies are assumed to have the nominal angle and the nominal thickness.
  * **layers**: List of dicts with the following entries:
    * `fabric`: Fabric of the layer (Stackups and Sublaminates are not supported).
    * `angle`: Nominal angle at Reference Radius with respect to the axis of symmetry (in degree).
    * `selection_rule_limits`: A dictionary with the entries “upper” and “lower”
      that define the extent of the plies in axial direction.
      The “upper” and “lower” values are interpreted as distance from the origin along
      the `axial_direction`.
    * `add_mirrored_ply`: If True an addtional layer with the same properties but
      a negative angle is generated. This implies that the resulting thickness is
      twice the original thickness of the layer.
  * **number\_of\_digits\_angle**, optional: Lookup tables for the angles are shared between different layers with similar angles. Default is `3`.
    Angles which are equal until **number\_of\_digits\_angle** after the
    decimal point share the same lookup table.
  * **max\_angle\_with\_thickness\_correction**: The thickness for layers where abs(angle) > **max\_angle\_with\_thickness\_correction** is not
    corrected. These layers always have the nominal
    layer thickness.
- **Usage:**
  ```python theme={null}
  >>> model.add_winding_entities(
                    axial_direction=(1.0, 0.0, 0.0),
                    origin=(0.0, 0.0, 0.0),
                    reference_radius=0.1,
                    layers=[{
                        "fabric": db.models['ACP Model'].material_data.fabrics['Fabric.1'],
                        "angle": 30.0,
                        "selection_rule_limits": {
                            "upper": 1,
                            "lower": 0.0
                            },
                        "add_mirrored_ply": True
                    }]
                )
  ```
- **Returns:**
  Dict of generated objects.

#### *property* analysis\_model\_path

Analysis model file path.

#### *property* angle\_tolerance

Section computation angle tolerance (in degree).

#### average\_element\_size()

Average element size of the model.

#### *property* cache\_update\_results

Define whether to store the update results.

#### copy\_combined\_failure\_criteria(source)

Copy a combined failure criteria definition.

* **Parameters:**
  * `source`: Source object to copy.
* **Returns:**
  New instance of combined failure criteria definition.

#### copy\_edge\_set(source)

Copy an edge set.

* **Parameters**
  * **source**: Source object to copy.

* **Returns:**
  New instance of edge set.

#### copy\_element\_set(source)

Copy an element set.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of element set.

#### copy\_field\_definition(source)

Copy a FieldDefinition.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of FieldDefinition.

#### copy\_lookup\_table(source)

Copy a lookup table.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of a lookup table.

#### copy\_oriented\_selection\_set(source)

Copy an oriented element set.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of oriented element set.

#### copy\_rosette(source)

Copy a rosette.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of rosette.

#### copy\_sampling\_point(source)

Copy a sampling point.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of a sampling point.

#### copy\_section\_cut(source)

Copy a section cut.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of a section cut.

#### copy\_selection\_rule(source)

Copy a rule.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of rule.

#### copy\_sensor(source)

Copy a sensor.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of a sensor.

#### copy\_solid\_model(source)

Copy a solid model.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of a solid model.

#### create\_boolean\_selection\_rule(name, id=None, include\_rule\_type=True, selection\_rules=\[])

Create a new boolean selection rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **id**: ID of the rule.
  * **include\_rule\_type**: Whether the rule is of include or exlude type.
  * **selection\_rules**: list of tuples of attached rules, operation type, and template parameters.
* **Returns:**
  The created boolean selection rule.
* **Example:**

```python theme={null}
  >>> model.create_boolean_selection_rule(‘Boolean Rule 1’, include_rule_type=True, selection_rules=[(rule1, ‘intersect’, False, (0,1)), (rule2, ‘remove’, True, (20, 4))])
```

#### create\_combined\_failure\_criteria(name, set=\[], id=None)

Create a combined failure criteria.

* **Parameters:**
  * **name**: Name for the combined failure criteria.
  * **set**: Set of failure criteria to be assigned.
  * **id**: ID to be assigned (optional).
* **Returns:**
  The created combined failure criteria.

#### create\_cutoff\_selection\_rule(name, id=None, cutoff\_rule\_type='geometry', offset=0.0, angle=0.0, origin=(0.0, 0.0, 0.0), direction=(1.0, 0.0, 0.0), distance\_type='along\_direction', ply\_cutoff\_type='production\_ply\_cutoff', ply\_tapering=False, cutoff\_geometry=None, edge\_set=None, offset\_method='laminate\_stack', offset\_type='out\_of\_plane')

Create new cut-off rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **cutoff\_rule\_type**:  Options:
    * `geometry`
    * `taper`
    * `variable_taper`
  * **offset**: Offset of the rule.
    * `float` for **cutoff\_rule\_type** = `geometry` or `taper`
    * `LookUpTableColumn` for **cutoff\_rule\_type** = `variable_taper`
  * **angle**: Angle of the rule.
    * Ignored for **cutoff\_rule\_type** = `geometry`
    * `float` for **cutoff\_rule\_type** = `taper`
    * `LookUpTableColumn` for **cutoff\_rule\_type** = `variable_taper`
  * **origin**: Origin of the offset and angle interpolation for `variable_taper`.
  * **direction**: Direction of the offset and angle interpolation for `variable_taper`.
  * **distance\_type**: `along_direction` or `along_edge` (only relevant for `variable_taper`).
  * **ply\_cutoff\_type**: Determines on which ply level the cutoff is done.
  * **ply\_tapering**: Use ply tapering.
  * **cutoff\_geometry**: CADGeometry for the rule (only relevant for **cutoff\_rule\_type** = `geometry`).
  * **edge\_set**: Edge Set for `cutoff_rule_type` = `taper` or `variable_taper`.
  * **offset\_method**: Method to compute offset of plies. Options:
    * `laminate_stack`
    * `attached_plies`
  * **offset\_type**: Measure offset from edge set normal to element reference surface (`out_of_plane`) or in element reference surface (`in_plane`).
* **Returns:**
  The created rule.

#### create\_cylindrical\_selection\_rule(name, id=None, origin=None, direction=None, radius=None, relative\_rule\_type=False, include\_rule\_type=True, rosette=None, use\_global\_coordinate\_system=None)

Create new cylindrical selection rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **origin**: Origin of the cylindrical rule.
  * **direction**: Direction of the cylindrical rule.
  * **radius**: Radius of the cylindrical rule.
  * **relative\_rule\_type**: If True, then the parameters are evaluated relative to size of the object.
  * **include\_rule\_type**: Include or exclude area in rule.
  * **use\_global\_coordinate\_system**: Use global coordinate system to define rule parameters.
  * **rosette**: Rosette used if **use\_global\_coordinate\_system** is `false`.
* **Returns:**
  The created cylindrical rule.

#### create\_edge\_set(name, id=None, origin=(0.0, 0.0, 0.0), limit\_angle=-1.0, edge\_set\_type='By Reference', element\_set=None, node\_labels=\[], show=False)

Create a new edge set.

* **Parameters:**
  * **name**: Name of the edge set.
  * **edge\_set\_type**: Edge set type. Options:
    * `By Nodes`
    * `By Reference`
    * `Imported` (only for imported edge sets)
  * **origin**: Origin.
  * **limit\_angle**: The edge set is cropped if the angle between two element edges exceeds this limit. Use `-1` to disable it.
  * **element\_set**: Element set.
  * **node\_labels**: List of nodes defining the edge set (only if **edge\_set\_type** = `By Nodes`).
* **Returns:**
  The created edge set.

#### create\_element\_set(name, id=None, element\_labels=None, element\_sets=None, x=None, y=None, z=None, op='new', middle\_offset=False, show=False)

Create a new element set.

* **Parameters:**
  * **name**: Name of the element set.
  * **element\_labels**: Labels of elements to be assigned to the element set.
  * **element\_sets**: Select elements of these sets.
  * **x**: X-range to select.
  * **y**: Y-range to select.
  * **z**: Z-range to select.
  * **op**: Select operation. Options:
    * `all`
    * `new` (default)
    * `add`
    * `remove`
    * `intersect`
    * `inverse`
    * `none`
  * `**middle_offset**`: Boolean to enforce that the laminate mid-plane is moved onto the reference surface.
* **Returns:**
  The created element set.

If element set already exists, it is updated depending on the operation given in `op`.

#### create\_envelope\_solution(name, id=None, solution\_sets=\[])

Create an envelope solution.

* **Parameters:**
  * **name**: Name for the envelope solution.
  * **solution\_sets**: List of solution sets that are combined.
* **Returns:**
  The new envelope solution object.

#### create\_field\_definition(name, id=None, field\_variable\_name=None, scope\_entities=None, scalar\_field=None, full\_mapping=False, active=True, locked=False)

Create a new field definition.

* **Parameters:**
  * **name**: The name of the field definition.
  * **id**: The ID of the field definition.
  * **field\_variable**: String identifier of the field.
  * **scope\_entities**: A list of scope entities defining the region of definition.
  * **scalar\_field**: Tabular scalar column defining the field.
  * **full\_mapping**: Boolean for whether offsets are to be included during the interpolation process.
* **Returns:**
  The created field definition.

#### create\_geometrical\_selection\_rule(name, geometrical\_rule\_type='geometry', id=None, use\_defaults=True, in\_plane\_capture\_tolerance=0.0, neg\_capture\_tolerance=0.0, pos\_capture\_tolerance=0.0, include\_rule\_type=True, geometry=None, use\_projection\_normal=False, projection\_normal=(0.0, 0.0, 0.0), element\_sets=None)

Create new geometrical selection rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **geometrical\_rule\_type**: Define whether the rule extent is defined by a geometry of element sets. Options:
    * `geometry` (default)
    * `element_sets`.
  * **use\_defaults**: Whether to use the offset value of the CAD geometry.
  * **in\_plane\_capture\_tolerance**: In-plane extend (extend) if CAD geometry is a surface.
  * **neg\_capture\_tolerance**: Offset in the negative direction if CAD geometry is a surface.
  * **pos\_capture\_tolerance**: Offset in the positive direction if CAD geometry is a surface.
  * **include\_rule\_type**: Whether the selection is inside or outside the CAD geometry.
  * **geometry**: CAD geometry used to determine the selection (only relevant for **geometrical\_rule\_type** = `geometry`).
  * **use\_projection\_normal**: Boolean on whether to use the projection normal.
  * **projection\_normal**: Normal direction used to map elements on outlines/curves.
  * **element\_sets**: Preselection of elements in the form of an element set where the rule is applied on (only relevant for **geometrical\_rule\_type** = `element_sets`).
* **Returns:**
  The created rule.

#### create\_imported\_solid\_model(name, id='', active=True, external\_file\_path=None, unit\_system='undefined', format='ansys:cdb', ext\_id='', use\_default\_element\_index=True, element\_index=0, use\_default\_node\_index=True, node\_index=0, use\_default\_section\_index=True, section\_index=0, use\_default\_material\_index=True, material\_index=0, use\_default\_coordinate\_system\_index=True, coordinate\_system\_index=0, use\_solsh\_elements=False, drop\_hanging\_nodes=True, use\_solid\_model\_prefix=True, write\_degenerated\_elements=True, delete\_bad\_elements=True, warping\_limit=0.4, minimum\_volume=0.0, global\_cut\_off\_material=None, transfer\_all\_sets=True, transferred\_element\_sets=\[], transferred\_edge\_sets=\[], locked=False, from\_pre=False)

Create a new solid model.

* **Parameters:**
  * **name**: The name of the solid model.
  * **id**: The ID of the solid model.
  * **active**: Active status of the solid model.
  * **external\_file\_path**: File path to the external source.
  * **unit\_system**: Unit system of the imported mesh.
  * **format**: File format of the external source.
  * **use\_default\_element\_index**: Consecutive element numbering if set to `true`.
  * **element\_index**: Start index for first element (only relevant if using **use\_default\_element\_index**).
  * **use\_default\_node\_index**: Consecutive node numbering if set to `true`.
  * node\_index: Start index for first node (only relevant if **use\_default\_node\_index**).
  * **use\_default\_section\_index**: Consecutive section numbering if set to `true`.
  * **section\_index**: Start index for first element (only relevant if using **use\_default\_section\_index**).
  * **use\_default\_material\_index**: Consecutive material numbering if set to `true`.
  * **material\_index**: Start index for first element (only relevant if using **use\_default\_material\_index**).
  * **use\_default\_coordinate\_system\_index**: Consecutive coordinate system numbering if set to `true`.
  * **coordinate\_system\_index**: Start index for first coordinate system (only relevant if **use\_default\_coordinate\_system\_index**).
  * **use\_solsh\_elements**: The solid model is created out of solsh elements.
  * **drop\_hanging\_nodes**: Whether to skip mid-side nodes that are not shared by adjacent elements. Only relevant when the object has applies cut-off geometries and a quadratic mesh.
  * **use\_solid\_model\_prefix**: The name of the solid model is used as a prefix for all components written to the \*cdb file.
  * **write\_degenerated\_elements**: If `false`, degenerated (homogeneous) elements are not exported.
  * **delete\_bad\_elements**: Boolean for whether to delete the erroneous elements.
  * **warping\_limit**: Warping limit factor used to detect erroneous elements.
  * **minimum\_volume**: Minimum volume of solid elements. Default is `0`.  Elements equal or smaller than this limit are removed from the solid model.
  * **global\_cut\_off\_material**: Defines the global cut-off material.
  * **transfer\_all\_sets**: Defines whether all edge and element sets should be transferred to the solid model.
  * **transferred\_element\_sets**: Element sets to transfer to the solid model if transfer\_all\_sets is set to `false`.
  * **transferred\_edge\_sets**: Edge sets to transfer to the solid model if transfer\_all\_sets is set to `false`.
* **Returns:**
  The created imported solid model.

#### create\_lookup\_table1d(name, id='', tabular\_data=None, origin=None, direction=None, dimensions=\[])

Create a new 1D lookup table object.

* **Parameters:**
  * **name**: Name.
  * **id**: ID.
* **Returns:**
  The created lookup table object.

#### create\_lookup\_table3d(name, id='', tabular\_data=None, algorithm\_type='weighted\_nearest\_neighbor', use\_default\_search\_radius=True, search\_radius=0.0, num\_min\_neighbors=1, dimensions=\[])

Create a new 3D lookup table object.

* **Parameters:**
  * **name**: Name.
  * **id**: ID.
  * **tabular\_data**: Data points and values of the lookup table.
  * **algorithm\_type**: Specify which algorithm type is used for the interpolation.
  * **use\_default\_search\_radius**: Force the program to use the default search radius. Used for the algorithm *weighted\_nearest\_neighbor*.
  * **search\_radius**: Set a custom search radius. Used if **use\_default\_search\_radius** is `false`. Used for the algorithm *weighted\_nearest\_neighbor*.
  * **dimensions**: List of the dimensions of the columns (e.g. length for coordinates).
* **Returns:**
  The created lookup table object.

#### create\_oriented\_selection\_set(name, id=None, orientation\_point=(0.0, 0.0, 0.0), orientation\_direction=(0.0, 0.0, 0.0), element\_sets=None, geometries=None, rosettes=None, rosette\_selection\_method='minimum\_angle', selection\_rules=None, draping=False, draping\_seed\_point=(0.0, 0.0, 0.0), auto\_draping\_direction=True, draping\_direction=(0.0, 0.0, 1.0), draping\_mesh\_size=0.0, use\_default\_draping\_mesh\_size=True, draping\_material\_model='woven', draping\_ud\_coefficient=0.0, reference\_direction\_field=None, rotation\_angle=0.0)

Create a new oriented selection set.

* **Parameters:**
  * **name**: The name of the oriented element set.
  * **id**: The ID of the oriented element set.
  * **orientation\_point**: Orientation point for the oriented selection set.
  * **orientation\_direction**: Orientation direction for the oriented selection set.
  * **element\_sets**: Element sets.
  * **geometries**: Virtual geometries.
  * **rosettes**: Rosettes for the oriented selection set.
  * **rosette\_selection\_method**: Method to calculate element orientation. Options:
    * `minimum_angle`
    * `maximum_angle`
    * `minimum_distance`
    * `minimum_angle_superposed`
    * `minimum_distance_superposed`
    * `maximum_angle_superposed`
    * `ansys_classic`
    * `tabular_values`
  * **reference\_direction\_field**: Table column used to compute reference directions.
  * **draping**: Draping enabled.
  * **draping\_seed\_point**: Seed point used to start draping.
  * **draping\_direction**: Direction for draping.
  * **auto\_draping\_direction**: Generate direction for draping.
  * **draping\_mesh\_size**: Mesh size for draping.
  * **use\_default\_draping\_mesh\_size**: Enable this property to use the default size for the draping mesh. The default is the average element size of the shell mesh.
  * **draping\_material\_model**: Material model for draping. Options:
    * `woven`
    * `unidirectional`
  * **draping\_ud\_coefficient**: Coefficient for the unidirectional draping material model.
  * **rotation\_angle**: Angle to rotate the reference directions around the orientation directions (in degree).
* **Returns:**
  The created oriented selection set.

#### create\_parallel\_selection\_rule(name, id=None, origin=None, direction=None, pos\_distance=None, neg\_distance=None, relative\_rule\_type=False, use\_global\_coordinate\_system=None, rosette=None, include\_rule\_type=True)

Create a new parallel selection rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **origin**: Origin of the parallel selection rule.
  * **direction**: Direction of the parallel selection rule.
  * **pos\_distance**: Positive distance of the parallel selection rule.
  * **neg\_distance**: Negative distance of the parallel selection rule.
  * **relative\_rule\_type**: If `True`, then the parameters are evaluated relative to size of the object.
  * **use\_global\_coordinate\_system**: Use global coordinate system to define rule parameters.
  * **rosette**: Rosette used if **use\_global\_coordinate\_system** is `false`.
  * **include\_rule\_type**: Include or exclude area in rule.
* **Returns:**
  The created parallel selection rule.

#### create\_published\_parameter(name, source\_object=None, source\_property='', user\_script='', category='input', acp\_type=None, description='', lower\_limit=None, upper\_limit=None, cyclic=False, float\_list=\[], string\_list=\[], unbound\_value=None)

Create a published parameter.

* **Parameters:**
  * **name**: Name of the parameter.
  * **source\_object**: Name of the object the parameter is linked to.
  * **source\_property**: Property of the linked object the parameter controls.
  * **user\_script**: Script to be executed for determining the parameter value. Only used when **category** = `expression_output`.
  * **category**: Controls the behavior of the parameter. Options:
    * `input`
    * `unbound_input`
    * `output`
    * `expression_output`
  * **acp\_type**: Type of the parameter, as used within ACP.
  * **description**: String description of the parameter.
  * **lower\_limit**: The lower limit for numeric values.
  * **upper\_limit**: The upper limit for numeric values.
  * **cyclic**: Whether a float value is cyclic.
  * **float\_list**: A list of possible values for a float.
  * **string\_list**: A list of possible values. List of objects if the property type is object, else list of strings.
  * **unbound\_value**: The value of the parameter, if **category** = `unbound_input`. In this case, the parameter is not linked to an existing object.
* **Returns:**
  The created published parameter.

#### create\_rosette(name, id=None, origin=(0.0, 0.0, 0.0), dir1=(1.0, 0.0, 0.0), dir2=(0.0, 1.0, 0.0), rosette\_type='PARALLEL', edge\_set=None, show=False)

Create a new rosette.

* **Parameters:**
  * **name**: The name of the rosette.
  * **id**: ID (optional).
  * **origin**: The origin of the rosette.
  * **dir1**: Direction 1 of the rosette.
  * **dir2**: Direction 2 of the rosette.
  * **rosette\_type**: Type of the rosette. Options:
    * `PARALLEL`
    * `RADIAL`
    * `CYLINDRICAL`
    * `SPHERICAL`
    * `EDGE_WISE`
  * **edge\_set**: Edge set to be used in rosette.
  * **show**: Whether the newly created rosette is shown in the scene or 3D window.
* **Returns:**
  The created rosette.
* **Example:**
  ```python theme={null}
  >>> rosette_1 = model.create_rosette('Rosette.1',
                                       origin=(0.,0.,0.),
                                       dir1=(1.,0.,0.),
                                       dir2=(0.,1.,0.),
                                       rosette_type='PARALLEL')
  ```

#### create\_sampling\_point(name, id=None, point=(0.0, 0.0, 0.0), direction=(0.0, 0.0, 0.0), locked=False, use\_default\_reference\_direction=True, rosette=None, offset\_is\_middle=True, consider\_coupling\_effect=True, solution\_set=None)

Create a new sampling point.

* **Parameters:**
  * **name**: Name of the sampling point.
  * **point**: Sampling point.
  * **direction**: Sampling direction.
  * **use\_default\_reference\_direction**: Whether to use the default reference direction for the evaluation.
  * **rosette**: Rosette used for the evaluation of the reference direction.
  * **offset\_is\_middle**: Specifies the offset of the reference plane used for the CLT analyses.
  * **consider\_coupling\_effect**: Specifies whether the laminate properties are evaluated considering the coupling effect (B matrix).
  * **solution\_set**: Specifies the solution and the set of the element-wise postprocessing. Note that this must be given as a tuple.
* **Returns:**
  The created sampling point.

#### create\_scene(name, id=None, title='', active\_set=None, projection='perspective', lighting\_mode='dark', scale\_factor=1.0, show\_draped\_fiber\_directions=False, show\_draped\_transverse\_directions=False, show\_edges=False, show\_fiber\_directions=False, show\_global\_coordinate\_system=True, show\_legend=True, show\_normals=False, show\_orientations=False, show\_ref\_directions=False, show\_selected\_mesh=False, show\_section\_cut\_plots=False, show\_element\_type=ObjectSectionElementTypes.automatic, show\_surface=True, show\_minmax=False, show\_transverse\_directions=False, continuous\_pick\_enabled=False, show\_material\_1\_directions=False, show\_mesh\_silhouette=False, show\_silhouette=True)

Create a new scene.

* **Parameter:**
  * **name**: Name of the scene.
  * **show\_deformed\_mesh**: Whether to show the deformed mesh.
  * **show\_undeformed\_mesh**: Whether to show the undeformed mesh.
  * **scale\_factor**: Scale factor of the deformed mesh.
* **Returns:**
  New scene.

#### create\_script(name, source=None, active=True, uptodate=False, update\_mode=ScriptUpdateMode.ON\_TRIGGERS)

Creates a script object, which enables executing custom Python code.

* **Parameters:**
  * **name**: The name of the script.
  * **source**: The code to be executed, as a string.
  * **active**: If False, the script will not be executed.
  * **uptodate**: Whether the script currently needs to be executed.
  * **update\_mode**: Defines which changes cause the script to become out-of-date. Options:
    * `manual` (run only when manually
      triggered)
    * `on_triggers` (run when a parameter or the script
      itself changes)
    * `always` (run with every update)
* **Returns:**
  The created script object.

#### create\_section\_cut(name, id=None, active=True, origin=(0.0, 0.0, 0.0), normal=(0.0, 0.0, 1.0), in\_plane\_reference\_direction1=(1.0, 0.0, 0.0), scale\_factor=1.0, core\_scale\_factor=1.0, intersection\_type='normal\_to\_surface', section\_cut\_type='modeling\_ply\_wise', extrusion\_type='wire\_frame', use\_default\_tolerance=True, tolerance=0.0, use\_default\_lut\_settings=True, search\_radius=0.0, number\_of\_interpolation\_points=1, scope\_entire\_model=True, scope\_element\_sets=(), locked=False)

Creates a new section cut.

* **Parameters:**
  * **name**: The name of the section cut.
  * **id**: The ID of the section cut.
  * **active**: Whether the section cut is active.
  * **origin**: Origin of the section cut plane.
  * **normal**: Normal of the section cut plane.
  * **in\_plane\_reference\_direction1**: Local x-direction of the section cut.
  * **scale\_factor**: Scale factor for the thicknesses.
  * **core\_scale\_factor**: Scale factor for core materials.
  * **intersection\_type**: Intersection type for the wireframe section cut.
  * **section\_cut\_type**: Ply resolution.
  * **extrusion\_type**: Type of representation and extrusion.
  * **use\_default\_tolerance**: Whether to use the default tolerance. Default is `0.1`% of the averaged element size.
  * **tolerance**: Tolerance used to generate the surface section cut.
  * **use\_default\_lut\_settings**: Use default interpolation properties for the sweep based extrusion.
  * **search\_radius**: Search radius of the interpolation algorithm.
  * **number\_of\_interpolation\_points**: Number of points of the interpolation algorithm.
  * **scope\_entire\_model**: Whether to scope the section cut to the entire model, or only selected element sets.
  * **scope\_element\_sets**: Element sets to which the section cut is scoped, if **scope\_entire\_model** = `False`.

* **Returns:**
  The new section cut object.

#### create\_sensor(name, id=None, active=True, sensor\_type='SENSOR\_BY\_AREA', entities=None, locked=False)

Create new sensor.

* **Parameters:**
  * **name**: Name of the rule.
  * **active**: Whether the sensor is active.
  * **sensor\_type**: Type of sensor. Options:
    * `SENSOR_BY_AREA`
    * `SENSOR_BY_MATERIAL`
    * `SENSOR_BY_PLIES`
  * **entities**: Entities of the sensor.
* **Returns:**
  The created sensor.

#### create\_solid\_model(name, id='', active=True, element\_sets=None, ex\_type=None, drop\_off\_type=None, offset\_type=None, max\_thickness=None, ply\_group\_pointers=None, element\_set=None, skip\_elements\_without\_plies=False, use\_default\_element\_index=True, element\_index=0, use\_default\_node\_index=True, node\_index=0, use\_default\_section\_index=True, section\_index=0, use\_default\_material\_index=True, material\_index=0, use\_default\_coordinate\_system\_index=True, coordinate\_system\_index=0, connect\_butt\_joined\_plies=True, write\_degenerated\_elements=True, use\_solsh\_elements=False, use\_solid\_model\_prefix=True, global\_drop\_off\_material=None, global\_cut\_off\_material=None, transfer\_all\_sets=True, transferred\_element\_sets=\[], transferred\_edge\_sets=\[], delete\_bad\_elements=True, disable\_dropoffs\_on\_top=False, disable\_dropoffs\_on\_bottom=False, disable\_dropoff\_sets\_on\_top='all', disable\_dropoff\_sets\_on\_bottom='all', warping\_limit=0.4, minimum\_volume=0.0, drop\_hanging\_nodes=True, locked=False)

Create a new solid model.

* **Parameters:**
  * **name**: The name of the solid model.
  * **id**: The ID of the solid model.
  * **active**: Active status of the solid model.
  * **element\_sets**: A list of element sets.
  * **ex\_type**: Extrusion method. Possible values are:
    * `monolithic` (1 element through the thickness)
    * `analysis_ply_wise` (1 element per layer)
    * `modeling_ply_wise` (1 element for each modeling ply)
    * `production_ply_wise` (1 element for each production ply)
    * `specify_thickness` (1 element per layer, layers thicker than **max\_thickness** are split to several solids of at most **max\_thickness**)
    * `user_defined` (groups plies by global ply numbers to groups)
    * `material_wise` (groups subsequent plies with equal material)
  * **drop\_off\_type**: Drop off type. Options:
    * inside ply (one element inside the ply boundary)
    * outside ply (one element outside the ply boundary).
  * **offset\_type**: Offset type. Options:
    * shell normal (offset to the shell normal)
    * surface normal (update normal direction by normal of layered solids)
    * distortion controlled (surface normal with local corrections)
  * **max\_thickness**: Maximum thickness for one solid, splits the layer into more solids, if a single layer is thicker than this value (only for **ex\_type** = `specify thickness`).
  * **ply\_group\_pointers**: Step used to make user-defined ply groups.
  * **element\_set**: (deprecated; use **element\_sets** instead) A single element set.
  * **skip\_elements\_without\_plies**: Whether to remove elements without plies from the region of extrusion.
  * **use\_default\_element\_index**: Consecutive element numbering if set to `true`.
  * **element\_index**: Start index for first element (only relevant if using **use\_default\_element\_index**).
  * **use\_default\_node\_index**: Consecutive node numbering if set to `true`.
  * **node\_index**\`: Start index for first node (only relevant if using **use\_default\_node\_index**).
  * **use\_default\_section\_index**: Consecutive section numbering if set to `true`.
  * **section\_index**: Start index for first element (only relevant if using **use\_default\_section\_index**).
  * **use\_default\_material\_index**: Consecutive material numbering if set to `true`.
  * **material\_index**: Start index for first element (only relevant if using **use\_default\_material\_index**).
  * **use\_default\_coordinate\_system\_index**: Consecutive coordinate system numbering if set to `true`.
  * **coordinate\_system\_index**: Start index for first coordinate system (only relevant if using **use\_default\_coordinate\_system\_index**).
  * **connect\_butt\_joined\_plies**: Connect adjacent plies without intermediate drop-offs.
  * **write\_degenerated\_elements**: Degenerated drop-off and cut-off elements are written to the \*.cdb file.
  * **use\_solsh\_elements**: The solid model is created out of solsh elements.
  * **use\_solid\_model\_prefix**: The name of the solid model is used as a prefix for all components written to the \*.cdb file.
  * **global\_drop\_off\_material**: Defines the global drop-off material.
  * **global\_cut\_off\_material**: Defines the global cut-off material.
  * **transfer\_all\_sets**: Defines whether all edge and element sets should be transferred to the solid model.
  * **transferred\_element\_sets**: Element sets to transfer to the solid model if transfer\_all\_sets is set to `false`.
  * **transferred\_edge\_sets**: Edge sets to transfer to the solid model if transfer\_all\_sets is set to `false`.
  * **delete\_bad\_elements**: Boolean for whether to delete the erroneous elements.
  * **disable\_dropoffs\_on\_top**: Boolean for whether to disalbe the drop-off elements on the top surface of the laminate.
  * **disable\_dropoffs\_on\_bottom**: Boolean for whether to disalbe the drop-off elements on the bottom surface of the laminate.
  * **disable\_dropoff\_sets\_on\_top**: List of element or oriented selection sets defining the region where the drop-offs are disabled on the top skin of the laminate. Default is `all`.
  * **disable\_dropoff\_sets\_on\_bottom**: List of element or oriented selection sets defining the region where the drop-offs are disabled on the bottom skin of the laminate. Default is `all`.
  * **warping\_limit**: Warping limit factor used to detect erroneous elements.
  * **minimum\_volume**: Minimum volume of solid elements. Default is `0`. Elements equal or smaller than this limit are removed from the solid model.
  * **drop\_hanging\_nodes**: Hanging nodes are dropped (not exported) if set to `true`. Hanging nodes are mid-side nodes that are not shared by adjacent elements.
* **Returns:**
  The created solid model.

#### create\_spherical\_selection\_rule(name, id=None, origin=None, radius=None, relative\_rule\_type=False, include\_rule\_type=True, use\_global\_coordinate\_system=None, rosette=None)

Create a new spherical selection rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **origin**: Origin of the spherical selection rule.
  * **radius**: Radius of the spherical selection rule.
  * **relative\_rule\_type**: Flag for relative rule.
  * **include\_rule\_type**: Include or exclude area in rule.
  * **use\_global\_coordinate\_system**: Use global coordinate system to define rule parameters.
  * **rosette**: Rosette used if **use\_global\_coordinate\_system** is `false`.
* **Returns:**
  The created spherical selection rule.

#### create\_tube\_selection\_rule(name, id=None, outer\_radius=1.0, inner\_radius=0.0, include\_rule\_type=True, edge\_set=None, extend\_endings=False, symmetrical\_extension=True, head=(0.0, 0.0, 0.0), head\_extension=0.0, tail\_extension=0.0)

Create a new tube selection rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **outer\_radius**: The outer radius of the tube.
  * **inner\_radius**: The inner radius of the tube.
  * **include\_rule\_type**: Include or exclude area in rule.
  * **edge\_set**: Edge set for the rule.
  * **extend\_endings**: Whether to extend the endings of the tube.
  * **symmetrical\_extension**: If enabled, then the length of the extensions will be equal on both sides.
  * **head**: The free end which is closer to this point becomes the head of the tube. It is only necessary if **symmetrical\_extension** is disabled.
  * **head\_extension**: Defines the length of the extension at the head of the tube. If **symmetrical\_extension** is enabled, it defines both sides.
  * **tail\_extension**: Defines the length of the extension at the tail of the tube if **symmetrical\_extension** is disabled.
* **Returns:**
  The created rule.

#### create\_variable\_offset\_selection\_rule(name, id=None, radius\_origin=None, radius\_direction=None, edge\_set=None, offsets=None, angles=None, element\_set=None, relative\_rule\_type=False, include\_rule\_type=True, use\_offset\_correction=False, distance\_along\_edge=False, inherit\_from\_lookup\_table=True)

Create new slab offset rule.

* **Parameters:**
  * **name**: Name of the rule.
  * **id**: The unique ID of the rule.
  * **radius\_origin**: Reference point of the 1D lookup table used for the offsets.
  * **radius\_direction**: Normal of the cutting plane.
  * **edge\_set**: Guide/axis of variable tube.
  * **offsets**: 1D lookup table including the radii of the variable tube.
  * **angles**: Optional taber edge angles.
  * **element\_set**: Preselection of elements in the form of an element set where the rule is applied on.
  * **include\_rule\_type**: Boolean whether to select the element inside or outside the variable tube.
  * **use\_offset\_correction**: Boolean whether to evaluate the radius/offset along the surface.
  * **distance\_along\_edge**: Boolean whether to evaluate the distance along the edge or direction of the rule. Default is `False`.
  * **inherit\_from\_lookup\_table**: Boolean whether to inherit origin and direction from the attached lookup table. Default is `False`.
* **Returns:**
  The created rule.

#### *property* definitions

Definitions.

#### *property* deformation\_scale\_factor

Factor with which the deformed shape plot is scaled.

#### *property* draping\_offset\_correction

Define whether to consider layup thickness in draping analysis.

#### *property* edge\_sets

Dictionary with all edge sets defined.

#### element\_normal(globalID)

Returns the element normal (direction).

* **Parameters:**
  * **globalID**: Element label.

#### *property* element\_sets

Dictionary with all element sets defined.

#### export(path)

Exports all ACP composite definitions as Python commands to a file.
Objects such as plots, views, ply book, etc. are not exported.

* **Parameters:**
  * **path**: The .acp file path.

#### export\_composite\_cae\_h5(path, remove\_midside\_nodes=True, layup\_representation\_3d=False, offset\_type='bottom\_offset', element\_sets=None, modeling\_plies=None, ascii\_encoding=False)

Export layup to composite CAE .hdf5 file.

* **parameters:**
  * **path**: Save path of the .h5 file.
  * **remove\_midside\_nodes**: Whether midside nodes should be exported.
  * **layup\_representation\_3d**: Whether to compute the 3D layup representation of the model. See note.
  * **offset\_type**: Specifies the ply surface to export. Options:
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`
  * **element\_sets**: A list of element sets and/or oriented selection sets. Only plies defined over the selected elements will be exported. If empty list or none, then all elements will be considered.
  * **modeling\_plies**: A list of modeling plies and/or modeling groups. If empty list or none, then all modeling plies will be exported.
  * **ascii\_encoding**: If `True`, set the .hdf5 data type for strings to H5T\_CSET\_ASCII. Note that the string contents will be UTF-8 encoded regardless of this setting, meaning the content will only be well-defined ASCII if the ACP object names do not contain unicode characters outside the ASCII range. This option is added for compatibility with readers which may not support the H5T\_CSET\_UTF8 data type.

***Note about layup\_representation\_3d:*** The 3D layup representation contains the offset ply surfaces where
the bottom offset of each ply is exported. The computation can take a while depending on the model size
and may fail if the model is too complex (shape and topology).
This can be resolved by exporting sub-parts (element sets).

#### export\_h5\_composite\_definitions(path)

Save composite definitions to .hdf5 file.
Function is mainly used to exchange composite definitions with the Ansys Workbench application.

* **parameters:**
  * **path**: Save path of the .h5 file.

#### export\_ply\_geometries(filename, plies=\[], boundary=True, surface=True, offset\_type='middle\_offset', direction\_arrows=False, first\_direction=True, second\_direction=False, arrow\_length=1.0, arrow\_type='no\_arrow')

Exports the surface, boundary, and/or fiber directions of modeling, production, and analysis ply to .igs or .step file.

* **Parameters:**
  * **filename**: File path. Extensions:
    * iges
    * igs
    * step
    * stp
    * stl
  * **plies**: List of plies. Options:
    * modeling
    * roduction
    * analysis plies
  * **boundary**: Boolean whether to export the boundary. Default is `True`.
  * **surface**: Boolean whether to export the ply surface. Default is `True`.
  * **offset\_type**: Offset type. Types:
    * `no_offset`
    * `middle_offset` (default)
    * `top_offset`
    * `bottom_offset`
  * **direction\_arrows**: Boolean whether to export the direction arrows. Default is `False`.
  * **first\_direction**: Boolean whether to export the first (main) material direction. Default is `True`.
  * **second\_direction**: Boolean whether to export the second material direction. Default is `False`.
  * **arrow\_length:** Length of the arrows. Default is `1`.
  * **arrow\_type**: Defines the arrow type. Types:
    * `standard_arrow`
    * `no_arrow` (default)
    * `half_arrow`

***Note:*** Directions and boundaries are not supported by the STL format.

#### export\_solid\_models(directory=None, prefix='ACPSolidModel\_', delete\_existing=True, formats=\['cdb', 'h5'], normalize\_filename\_for\_cdb=False)

Save solid models to files. Function is used within the Workbench application updates.

* **Parameters:**
  * **directory**: Directory to save the models.
  * **prefix**: Prefix of the model. Default is `ACPSolidModel_`.
  * **delete\_existing**: Flag if existing models should be deleted. Default is `true`.
  * **formats**: Available file formats are ‘cdb’ or ‘h5’. Default: `[‘cdb’, ‘h5’]`.
  * **normalize\_filename\_for\_cdb**: Whether the solid model name should be normalized
    for the .cdb filepath. This may be necessary because Mechanical APDL cannot read filenames
    that contain non-ASCII characters.

#### *property* field\_definitions

Dictionary with all defined field definitions.

#### find\_materials(\*\*properties)

Find materials with the given properties or property ranges.

* **Parameters:**
  * **properties**: Arbitrary material properties which must be matched. Note that a single property value can be given as string, number, or min-max range.

* **Returns:**
  A list with materials which match the given properties. If nothing matches, then an empty list is returned.

* **Examples:**

```python theme={null}
>>> materials = model.find_materials(E1=100000.0, nu12=0.3)
>>> materials = model.find_materials( name='1')
>>> materials = model.find_materials(E1=[200000.0, 220000.0], nu12=0.3, G12=[4500.0,5500.0])
```

#### *property* format

File format string. Options:

* `ansys:h5`
* `ansys:cdb`
* `ansys:dat`
* `layup`

#### *property* geometry

Geometry node.

#### get\_element\_by\_point(point)

Returns the element label of the closest element with respect to the given point.

* **Parameters:**
  * **point**: Tuple of the global coordinates.

#### get\_layup(path, format=None, objects=None, mode='update\_entities')

Load layup from excel or .csv file.

* **Parameters:**
  * **mode**: Options:
    * `update_properties_only`: Definitions are updated with properties given.
    * `update_entities`: Definitions are updated, additional plies are generated and deleted.
    * `recreate`: Existing layup is deleted generated from scratch.

#### get\_layup\_from\_csv\_file(path, objects=None, mode='update\_entities', modeling\_group=None)

Function that reads the layup data from a .csv file and adds the data to the graph.

* **Parameters:**
  * **objects**: List of objects to be synced.
  * **path**: The path to the file.
  * **mode**: Options:
    * `update_properties_only`: Definitions are updated with properties given.
    * `update_entities`: Definitions are updated, additional plies are generated and deleted.
    * `recreate`: Existing layup is deleted generated from scratch.
  * **modeling\_group**: Key of the mpg\_collection dict equals the ID of the mpg. Only plies of this modeling\_group will be imported from the file if none is specified all mpgs are read.

#### get\_layup\_from\_excel\_file(path, objects=None, mode='update\_entities')

Load layup from excel file.

* **Parameters:**
  * **path**: Path to file to load.
  * **objects**: Objects to be loaded and overwritten.
  * **mode**: Options:
    * `update_properties_only`: Definitions are updated with properties given.
    * `update_entities`: Definitions are updated, additional plies are generated and deleted.
    * `recreate`: Existing layup is deleted generated from scratch.

#### import\_composite\_cae\_h5(path, mode='append', projection='shell', tol\_thickness=None, tol\_in\_plane=None, tol\_angle=None, small\_hole\_threshold=None, tol\_min\_angle=None, recompute\_ref\_directions=False, element\_sets=None, offset='bottom\_offset', coord\_transform\_inputs=None)

Import a composite layup definition from a .hdf5 file.

* **Parameters:**
  * **path**: Load path of the .h5 file.
  * **mode**: Specify how objects are imported. Options:
    * `append`: Imported data/objects are appended to existing model/layup.
    * `overwrite`: Replace objects with equal ids in the model with imported instances if possible (not locked).
  * **projection**: Defines whether the imported data is treated as `shell` (default) or `solid` data. Options:
    * `shell`: Default. The imported components are mapped onto the reference surface and converted into modeling plies.
    * `solid`: The components are imported one-to-one and exposed as imported plies. Can be used in combination with ImportedSolidModel (layup mapping).
  * **tol\_thickness**: Mapping tolerance in element thickness direction relative to min element edge length.
  * **tol\_in\_plane**: Mapping tolerance in element in-plane direction relative to min element edge length.
  * **tol\_angle**: Mapping tolerance for the angles between element normals.
  * **small\_hole\_threshold**: Holes in plies/element sets with an area smaller than this threshold times the area of the element set/ply are filled.
  * **tol\_min\_angle**: Minimum angle tolerance for which tabular correction angles for plies are computed.
  * **recompute\_ref\_directions**: Whether reference directions should be recomputed from tabular angle data.
  * **element\_sets**: A list of element sets.
  * **offset**: Offset for imported plies. Defines if the imported mesh is interpreted as bottom, middle, or top ply surface. Options:
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`
  * **coord\_transform\_inputs**: Coordinate transformation for the imported data. Dict with the following properties:

    * “translation\_x”, “translation\_y”, “translation\_z”,
    * “rotation\_angle\_deg\_x”, “rotation\_angle\_deg\_y”, “rotation\_angle\_deg\_z”

    The data is transformed in the following order: Rotation X, Rotation Y, Rotation Z, Translation.

#### import\_composite\_definitions\_from\_acp\_file(path=None, import\_mode='keep\_both')

This functions loads the ACP composite definitions from an external ACP system.
Within the Workbench application, this function loads all objects except the mesh, materials, and plots.
In the stand-alone mode, all objects except mesh and plots are imported.

* **Parameters:**
  * **path**: \*.acp file path.
  * **import\_mode**: Defines how to solve conflicts of objects of equal name.
* **Global Resolution Actions:**
  * **keep\_both**: Keep target and source (default).
  * **keep\_existing**: Imported entities are ignored.
  * **overwrite**: Overwrite target with source.

#### import\_section\_data\_from\_legacy\_model(path, format='ansys:cdb', materials\_mask\_prefix='mat', materials\_mask\_suffix=' (setup, file1)')

Import and convert the layup of a legacy (Mechanical APDL) shell model into ACP composite definitions.

The mapping is based on the element labels and therefore it is a requirement that
the element labels in the legacy and ACP model match. The import is only performed if the file and ACP Model units are consistent.

* **Parameters:**
  * **path**: File path. Supported file extensions are CDB, DAT, and INP.
  * **format**: File format. Supported options:
    * `ansys:cdb`
    * `ansys:dat`
  * **materials\_mask\_prefix**: Defines the prefix that is added to the Material ID while importing materials via ExternalModel.
  * **materials\_mask\_suffix**: Defines the suffix that is added to the Material ID while importing materials via ExternalModel.
* **Materials mapping:**
  Only relevant when the import happens within the Workbench application.
  The materials mask prefix and suffix parameters enable automatic mapping of the Workbench application’s material and legacy material IDs.
  For instance the prefix and suffix, MAT1 and \`(Setup, File1)\` enable mapping MAT1 (Setup, File1) with legacy material 1.
  The mapping is case independent.
  Pass empty mapping masks when no mapping is needed.
* **Example:**
  ```python theme={null}
  >>> db.active_model.import_section_data_from_legacy_model(path=r'D:  mp\class40_analysis_model.cdb', format='ansys:cdb')
  ```

#### *property* layup\_plots

Plots.

#### *property* lookup\_tables

Dictionary with all lookup tables.

#### *property* material\_data

Dictionary with all material data defined.

#### *property* mesh

Mesh of this model.

#### mesh\_query(name, position, selection='all', entity=None, entities=None, simulate=False, component=None)

Query arbitrary data from the mesh of the model.

* **Parameters:**
  * **name**: Data type to query:
    * labels, indices
    * etypes
    * coordinates
    * angles (needs component)
    * thickness (needs component)
    * normals
    * orientations, ref\_directions, fiber\_directions, transverse\_directions
    * draped\_fiber\_directions, draped\_transverse\_directions
    * ply\_offsets (offset vector)
    * area, volume, mass, price
    * cog (centre of gravity)
    * offset (offset in the thickness direction)
  * **component**: Defines the component. Needed for name = `angles` or `thickness`.
    * `angles`: Options:
      * `design_angle` (default)
      * `shear`
      * `draped_fiber_angle`
      * `draped_transverse_angle`
    * `thickness`: Options:
      * `thickness` (default)
      * `relative_thickness_correction`
  * **position**: Position where data is queried. Options:
    * `nodal`
    * `centroid`
    * `element_nodal`
  * **selection**: The selection set determines the selected nodes and elements. Can be given as string or ObjectSelection.
    * Supported stings:
      * `sel0`-`sel5`
      * `all`
    * Supported ObjectSelection objects:
      * `model.selection`
      * `scene.active_set`
  * **entity**: Specialized queries require the specification of an additional associated entity. For instance, an oriented element set is needed to compute orientations.
    Entity can be given as NamedGraphObjects or vertex descriptor.
  * **entities**: If a list of entities is given, then the query will also compute and return a list of results, with one array for each entity.
  * **simulate**: Whether the query is only simulated to test if it will return data.
    If this flag is set the mesh\_query(…) function will only return 0 or 1.

#### *property* minimum\_analysis\_ply\_thickness

Section computation minimum analysis ply thickness (in length unit of model).

#### *property* modeling\_groups

Dictionary with all modeling groups defined.

#### *property* oriented\_selection\_sets

Dictionary with all oriented element sets defined.

#### *property* parameters

List of parameters visible to the Workbench application.

#### *property* path

Path to the reference surface input file. Read only.

#### plot\_dependencies(path=None, parent=None, levels=3)

Generates a graph with all dependencies. The output is a .dot, .png, and .pdf file.

* **Parameters:**
  * **path**: File path without file extension.
  * **parent**: Parent object.
  * **levels**: Depth levels to look for children.
* **Output:**
  A .dot file which can be opend with Graphviz.
* **Usage:**
  ```python theme={null}
  >>> model.plot_dependencies(r'C:\tmp\hull_dependencies', model.element_sets['HULL'], 3)
  ```

#### *property* plybook

PlyBook.

#### *property* pre\_path

Save path of pre-database linked to currently loaded post-database.

#### *property* reference\_surface\_bounding\_box

Tuple with corners of bounding box of reference surface mesh.

#### *property* reference\_surface\_input\_unit\_system\_locked

If the unit system of the reference surface is not defined in the mesh input, the unit system can be changed.

#### *property* reference\_surface\_input\_unit\_system\_type

Unit system of the reference surface input file.

#### refresh\_material\_data(matml\_file\_path, apdl\_file\_path)

Refresh material external data sources in the model .acph5 database. Needs the save\_path to be set.

#### *property* relative\_thickness\_tolerance

Section computation relative thickness tolerance.

#### reload\_mesh(path=None, format=None)

Reloads the mesh (nodes, elements, and named selections).
The following imported entities are ignored: materials and rosettes.

* **Parameters**
  * **path**: New mesh path. Default is the current model path.
  * **format**: New format. Default is the current format.

#### reorder\_modeling\_groups(source=\[], target=None, option='after')

Reorders the modeling groups by placing source before or after the target.

* **Parameters:**
  * **source**: List of modeling groups to insert at the new position.
  * **target**: A modeling group which defines the position to insert the source.
  * **option**: Whether to insert the source before or after the target.
* **Usage:**
  ```python theme={null}
  >>> model.reorder_modeling_groups(source=[modelmodeling_groups['DECK']], target=modelmodeling_groups['HULL'], option='before')
  ```

#### *property* rosettes

Dictionary with all rosettes defined.

#### *property* sampling\_points

Sampling point container.

#### save(path=None, cache\_data=None)

Save ACP model to .acph5 file.

* **Parameters:**

- **path**: Path to file.
- **cache\_data**: Whether to cache current state of model.

#### save\_analysis\_model(path)

Save actual analysis model to disc.

* **Parameters:**
  * **path**: Save path of the .cdb file.

#### save\_apdl\_commands(path)

Save APDL commands for composite definitions of actual model.

* **Parameters:**
  * **path**: Save path of the .cdb file.

#### save\_h5(path, cache\_data=False)

Save ACP model in .acph5 format.

#### save\_layup(path, format=None, objects=None)

Function that saves the layup data to a .csv file.

* **Parameters:**
  * **path**: The path to the file.
  * **format**: Format can be csv and excel (on Windows only).
  * **objects**: An optional parameter. If enabled, then the entire layup is written to the file. If disabled, only the layup defined within modeling\_groups is written to the file.

#### save\_layup\_to\_csv\_file(path, objects=None)

Function that saves the layup data to a .csv file.

* **Parameters:**
  * **path**: The path to the file.
  * **modeling\_groups**: An optional parameter. If enabled, then the entire layup is written to the file. If disabled, only the layup defined within **modeling\_groups** is written to the file.

#### save\_layup\_to\_excel\_file(path, objects=None)

Function that saves the layup data to an excel file (Windows only).

* **Parameters:**
  * **path**: The path to the file.
  * **objects**: An optional parameter. If enabled, then the entire layup is written to the file. If disabled, only the layup defined within modeling\_groups is written to the file.

#### *property* scenes

Scenes.

#### *property* scripts

List of user-defined scripts.

#### *property* section\_cuts

Section Cuts.

#### select\_elements(selection='sel0', op='new', labels=None, indices=None, attached\_to=None, x=None, y=None, z=None, element\_type='all')

Selects element within active model and marks the selection as SELECTED.

* **Parameters:**
  * **selection**: The selection to update.
    Can be given as string or an ObjectSelection object.
    * Supported strings:
      * `sel0`-`sel5`
      * `all`
    * ObjectSelection objects:
      * `model.selection`
      * `scene.active_set`
  * **op**: Select operation. Options:
    * `all`
    * `new` (default)
    * `add`
    * `remove`
    * `intersect`
    * `inverse`
    * `none`
  * **labels**: List with element labels to select.
  * **indices**: List with element indices to select.
  * **attached\_to**: Elements attached to entities/vertices in this list will be selected.
  * **x**: X-range to select.
  * **y**: Y-range to select.
  * **z**: Z-range to select.
  * **element\_type**: Element type. Options:
    * `solid`
    * `shell`

#### select\_nodes(selection='sel0', op='new', labels=None, attached\_to=None, x=None, y=None, z=None)

Function selects nodes in graph and marks the given selection as SELECTED.

* **Parameters:**
  * **selection**: The selection to update.
    Can be given as string or an ObjectSelection object.
    * Supported strings:
      * `sel0`-`sel5`
      * `all`
    * Supported ObjectSelection objects:
      * `model.selection`
      * `scene.active_set`
  * **op**: Select operation. Options:
    * `all`
    * `new` (default)
    * `add`
    * `remove`
    * `intersect`
    * `inverse`
    * `none`
  * **labels**: List with node labels to select.
  * **attached\_to**: Nodes attached to the given list of entities or vertices will be selected.
    If **attached\_to** = `elements`, then all nodes attached to selected elements are selected.
  * **x**: X-range to select.
  * **y**: Y-range to select.
  * **z**: Z-range to select.

#### select\_solid\_elements\_from\_shells(selection='sel0')

Selects the solid element within given selection and deselects the shell elements.

* **Parameters:**
  * **selection**: The selection to update. Can be given as string `sel0` - `sel5`.
* **Return:**
  Number of selected solid elements.

#### *property* selection

Selected objects of this model.

#### *property* selection\_rules

Dictionary with all selection rules defined.

#### *property* sensors

Dictionary with all sensors.

#### *property* show\_deformed

Whether to show result plots in the deformed and scaled configuration.

#### *property* show\_solver\_elements

Whether mesh selections and plot should consider solver elements in solid models.

#### *property* solid\_models

Solid model.

#### *property* solutions

Solutions.

#### solve(wait=False)

Convenience function to directly solve the current model.

* **Parameters:**
  * **wait**: Wait until solver process finishes computation.

#### *property* solver

Solver instance.

#### *property* unit\_system

Create a unit system and assign it to the model.
Supported unit system types:

* `si`
* `mks`
* `cgs`
* `umks`
* `mpa`
* `bft`
* `bin`
* `undefined`

#### update(objects='all', relations\_only=False)

Main update function.

* **Parameters:**
  * **objects**: List of objects to update.
  * **relations\_only**: Set this option to `true` to only update and propagate the status of all objects.

#### *property* use\_default\_section\_tolerances

Boolean whether to uses angle and thickness tolerances of the application preferences for section computation. Otherwise model specific values are used.

#### *property* use\_nodal\_thicknesses

Define whether to use nodal thicknesses or element thicknesses.

#### *property* views

Views.

#### wbupdate(objects='all', relations\_only=False)

Generate all output files of ACP for the Workbench application.

This function is part of the Workbench application’s integration and should not be called manually.

### `Rosette` class

#### *class* compolyx.Rosette(graph, obj, parent=None)

Rosette class.

* **Access:**

```python theme={null}
>>> model = db.models['class40.1']
>>> rosette_1 = model.rosettes['Rosette.1']
>>> rosette_2 = model.create_rosette(name='Rosette.2', origin=(1.5, 5.75, 7.), dir1=(-0.4, -0.4, 0.8), dir2=(-6.0, 0.6, 0.75), rosette_type='parallel' )
```

#### *property* changed

Status boolean. Set to `true` if the underlying data has been changed. Write only property.

#### *property* dir1

Direction 1 of the rosette.

#### *property* dir2

Direction 2 of the rosette.

#### *property* edge\_set

Edge set for rosette.

#### get\_global\_coordinates(coordinates)

Evaluates the global coordinates of a point given in local rosette coordinates:
CYLINDRICAL,  RADIAL, and SPHERICAL. Coordinate system type: Give phi and theta in RAD.

* **Parameters:**
  * **(x, y, z)**:
    * `x` = x for PARALLEL, and r for CYLINDRICAL, RADIAL and SPHERICAL
    * `y` = y for PARALLEL, and phi for CYLINDRICAL, RADIAL and SPHERICAL
    * `z` = z for PARALLEL, CYLINDRICAL and RADIAL, and theta for SPHERICAL
* **Usage:**
  ```python theme={null}
  >>> rosette.get_global_coordinates((1.,2.,3.))
  ```

#### get\_global\_vector\_components(vector)

Evaluates the global vector components of a point given in local rosette vector coordinates:
CYLINDRICAL,  RADIAL, and SPHERICAL. Coordinate system type: Give phi and theta in RAD.

* **Parameters:**
  * **(x, y, z)**:
    * `x` = x for PARALLEL, r for CYLINDRICAL, RADIAL and SPHERICAL
    * `y` = y for PARALLEL, phi for CYLINDRICAL, RADIAL and SPHERICAL
    * `z` = z for PARALLEL, CYLINDRICAL and RADIAL, and theta for SPHERICAL
* **Usage:**
  ```python theme={null}
  >>> rosette.get_global_vector_components((1.,2.,3.))
  ```

#### get\_local\_coordinates(coordinates)

Evaluates the local rosette coordinates of a point given in global coordinates:

* **Parameters:**
  * **(x, y, z)**: Coordinates in global (parallel) coordinates.

* **Returns:**
  * **(x,y,z)**:

    * `x` = x for PARALLEL, and r for CYLINDRICAL, RADIAL and SPHERICAL
    * `y` = y for PARALLEL, and phi for CYLINDRICAL, RADIAL and SPHERICAL
    * `z` = z for PARALLEL, CYLINDRICAL and RADIAL, and theta for SPHERICAL

    Coordinate system type: Give phi and theta in RAD.

* **Usage:**
  ```python theme={null}
  >>> rosette.get_local_coordinates((1.,2.,3.))
  ```

#### get\_local\_vector\_components(vector)

Returns local rosette vector components from global vector components.

* **Parameters:**
  * **(x, y, z)**: Components in global (parallel) coordinates.

* **Returns:**
  * **(x,y,z)**:

    * `x` = x for PARALLEL, and r for CYLINDRICAL, RADIAL and SPHERICAL
    * `y` = y for PARALLEL, and phi for CYLINDRICAL, RADIAL and SPHERICAL
    * `z` = z for PARALLEL, CYLINDRICAL and RADIAL, and theta for SPHERICAL

    Coordinate system type: Give phi and theta in RAD.

* **Usage:**
  ```python theme={null}
  >>> rosette.get_local_vector_components((1.,2.,3.))
  ```

#### local\_direction(point, angle)

Get local orientation for a given relative angle and position in space.

#### *property* locked

Rosette is generated from an imported rosette and cannot be changed.

#### *property* origin

Origin of the rosette.

#### *property* rosette\_type

Rosette type. Options:

* `parallel`
* `radial`
* `cylindrical`
* `spherical`
* `edge_wise`

#### serialize()

Serialize to Python string.

#### set\_Xy()

Sets dir2 orthogonal to dir1 as y- and x-axis.

#### set\_Xz()

Sets dir2 orthogonal to dir1 as z- and x-axis.

#### set\_Yz()

Sets dir2 orthogonal to dir1 as z- and y-axis.

#### set\_xY()

Sets dir1 orthogonal to dir2 as x- and y-axis.

#### set\_xZ()

Sets dir1 orthogonal to dir2 as x- and z-axis.

#### set\_yZ()

Sets dir1 orthogonal to dir2 as y- and z-axis.

## `LookUpTable` classes

### `LookUpTableBase` class

#### *class* compolyx.LookUpTableBase(obj, parent=None)

Bases: `NamedGraphFuncObject`

Lookup table class.

Associates scalar or vector values to points.

* **Example:**

```python theme={null}
>>> table = db.models['class40.1'].create_lookup_table1d(name='LookUpTable1D.1')
>>> table.columns['Location'].values = [0,1,2,3]
>>> db.models['class40.1'].lookup_tables['LookUpTable1D.2'].create_column( name='Radius', type='scalar' )
>>> r = db.models['class40.1'].lookup_tables['LookUpTable1D.2'].columns['Radius']
>>> r.values = [0,0.3,0.6,1]
```

#### *property* active

LookUpTable active.

#### clear()

Clear table data (rows and columns).

#### clear\_rows()

Clear table rows (keep columns).

#### *property* column\_types

A list of column types (`scalar` or `direction`).

#### *property* columns

Dictionary with all columns.

#### create\_column(name, type=None, values=None, dimension='dimensionless')

Create a new column.

* **Parameters:**
  * **name**: Name of column.
  * **type**: A string (`scalar` or `direction`) specifying the column type (the values will be initialized to NaN).
  * **values**: A numpy array with values (the type is determined from its shape).

#### *property* empty

True if table is empty.

#### load\_from\_csv\_file(path)

Load the table from .csv file in path.

Load LookUpTable from .csv file.

* **Parameters:**
  * **path**: Path to output file.

#### *property* num\_cols

Number of rows.

#### *property* num\_rows

Number of columns.

#### save\_to\_csv\_file(path)

Save LookUpTable to CSV file.

* **Parameters:**
  * **path**: Path to output file.

#### *property* tabular\_data

A tuple containing a list of column labels and a 2d array with floats for all cells. This is a flattened view of all columns.

### `LookUpTable1D` class

#### *class* compolyx.LookUpTable1D(obj, parent=None)

Bases: [`LookUpTableBase`](#compolyx.LookUpTableBase)

A LookUpTable to associate arbitrary data to a one-dimensional field of Locations.

#### column\_factory

alias of `LookUpTable1DColumn`.

#### *property* direction

The direction of the lookup table.

#### *property* origin

The origin of the lookup table.

#### *property* tabular\_data

A tuple containing a list of column labels and a 2d array with floats for all cells. This is a flattened view of all columns.

### `LookUpTable3D` class

#### *class* compolyx.LookUpTable3D(obj, parent=None)

Bases: [`LookUpTableBase`](#compolyx.LookUpTableBase)

A LookUpTable to associate arbitrary data to a three-dimensional field of locations.

#### *property* algorithm\_type

Algorithm. Types: nearest\_neighbor, linear\_multivariate, and weighted\_nearest\_neighbor.

#### column\_factory

alias of `LookUpTable3DColumn`.

#### *property* num\_min\_neighbors

Number of neighbors used for the interpolation with weighted nearest neighbor.

#### remove\_duplicate\_points()

Removes duplicate supporting points from the table.

* **Returns:**
  * Number of removed points.
* **Example:**

```python theme={null}
  >>> db.models[‘plate’].lookup_tables[‘LookUpTable3D_scalar’].remove_duplicate_points()
```

#### *property* search\_radius

Search radius used for the interpolation with weighted nearest neighbor.

#### *property* tabular\_data

A tuple containing a list of column labels and a 2D array with floats for all cells. This is a flattened view of all columns.

#### *property* use\_default\_search\_radius

True if the search radius is estimated automatically.

### `LookUpTableColumn` class

#### *class* compolyx.LookUpTableColumn(name, parent)

An object to hold a column in a table.

#### *property* enabled

Whether this object is currently enabled. Mainly defined through the current application mode (pre or post).

#### *property* status

Column status (`UPTODATE`, `NOTUPTODATE`, or `LOCKED`).

#### *property* type

Column type (`scalar` or `direction`).

#### *property* values

Numpy array containing the column values.

## `ElementSelectionRule` classes

### `ElementSelectionRule` class

#### *class* compolyx.ElementSelectionRule(graph, obj, parent=None)

Base class for rules.
This acts as an interface to the cpp object of the rules.
The base class implements `_py_update` which is called after the cpp update. It sets the changed flag.
Since NameGraph derives from Observable, observers can listen on `changed`.

In order to support csv\_serialization, the classes have to implement a `_dict` method
and a list named `_csv_parameters`.
The `_dict` method specifies which properties are written and `_csv_parameters` specifies which parameters are read and
how they are parsed. The keys in `_dict` and the elements in `_parameters_csv` have to be consistent.
If the conversion from the string to an object is more than simple type conversion,
it can be implemented in `_update_rule_from_csv`.

#### *property* changed

Triggers observable to dispatch changed message.

#### *property* extent

Extent of the rule.

#### *property* include\_rule\_type

Include type.

#### *property* relative\_rule\_type

Relative type.

### `ParallelSelectionRule` class

#### *class* compolyx.ParallelSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

Parallel selection rule.

#### *property* direction

Direction of the parallel selection rule.

#### *property* direction\_in\_global\_coordinates

Direction of the rule in global coordinates.

#### *property* neg\_distance

Negative distance.

#### *property* origin

Origin of the parallel selection rule.

#### *property* origin\_in\_global\_coordinates

Origin of the rule in global coordinates.

#### *property* pos\_distance

Positive distance.

#### *property* rosette

Rosette of the used for origin and direction.

#### serialize()

Serialize to Python string.

#### *property* use\_global\_coordinate\_system

Use global coordinate system for origin and direction.

### `CylindricalSelectionRule` class

#### *class* compolyx.CylindricalSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

Cylindrical selection rule.

#### *property* direction

Direction of the cylinder.

#### *property* direction\_in\_global\_coordinates

Direction of the rule in global coordinates.

#### *property* origin

Origin of the cylinder.

#### *property* origin\_in\_global\_coordinates

Origin of the rule in global coordinates.

#### *property* radius

Radius of the cylinder.

#### *property* rosette

Rosette of the used for origin and direction.

#### serialize()

Serialize to Python string.

#### *property* use\_global\_coordinate\_system

Use global coordinate system for origin and direction.

### `SphericalSelectionRule` class

#### *class* compolyx.SphericalSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

Spherical selection rule.

#### *property* direction\_in\_global\_coordinates

Direction of the rule in global coordinates.

#### *property* origin

Origin of the sphere.

#### *property* origin\_in\_global\_coordinates

Origin of the rule in global coordinates.

#### *property* radius

Sphere radius.

#### *property* rosette

Rosette of the used for origin and direction.

#### serialize()

Serialize to Python string.

#### *property* use\_global\_coordinate\_system

Use global coordinate system for origin and direction.

### `TubeSelectionRule` class

#### *class* compolyx.TubeSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

Tube selection rule.

#### *property* display\_data

The tube-rule mesh plot.

#### *property* edge\_set

Edge set for the tube selection rule.

#### *property* extend\_endings

Whether to extend the ending of the edge.

#### get\_nodes()

* **Returns:**
  List of nodes that define the central line of the tube.

#### *property* head

Defines the head of the tube. Only needed if the extensions are asymmetric.

#### *property* head\_extension

Specifies the length of the extension at the head of the tube.

#### *property* inner\_radius

Inner-tube radius.

#### *property* is\_closed

* **Returns:** True if the edge set of this rule is closed.

#### *property* mesh

The mesh of the tube rule.

#### *property* nodes

* **Returns:** The nodes of this tube as nx3 array including the extensions.

#### *property* outer\_radius

Outer-tube radius.

#### serialize()

Serialize to Python string.

#### *property* symmetrical\_extension

Whether the extensions are equal on both ends.

#### *property* tail\_extension

Specifies the length of the extension at the tail of the the tube.

### `CutoffSelectionRule` class

#### *class* compolyx.CutoffSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

#### *property* angle

Cut-off angle.

#### *property* cutoff\_geometry

Cut-off geometry for the cut-off rule.

#### *property* cutoff\_rule\_type

Cutoff rule type. Options:

* `geometry`
* `taper`
* `variable_taper`.

#### *property* direction

Direction of the offset and angle interpolation for `variable_taper`.

#### *property* distance\_type

Distance type for offset and angle interpolation for `variable_taper`.

#### *property* edge\_set

Edge Set for cutoff\_rule\_type = `taper` or `variable_taper`.

#### *property* offset

Cut-off offset.

#### *property* offset\_method

Method to compute the offset of a ply.

#### *property* offset\_type

Take offset from edge set perpendicular to element reference surface (out\_of\_plane) or in element reference surface (in\_plane).

#### *property* origin

Origin of the offset and angle interpolation for `variable_taper` cutoff rules.

#### *property* ply\_cutoff\_type

Cutoff type. Options:

* `production_ply_cutoff`
* `analysis_ply_cutoff`

#### *property* ply\_tapering

Use ply tapering orientation.

### `GeometricalSelectionRule` class

#### *class* compolyx.GeometricalSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

Geometrical selection rule.

#### add\_element\_set(element\_set)

Add element set to geometrical selection rule.

#### clear\_element\_sets()

Clear element sets of oriented selection set.

#### *property* element\_sets

Element Sets for the geometrical selection rule.

#### *property* geometrical\_rule\_type

Geometrical rule type. Options:

* `geometry`
* `element_sets`

#### *property* geometry

Virtual geometry for the geometrical selection rule.

#### *property* in\_plane\_capture\_tolerance

In-plane capture tolerance.

#### *property* neg\_capture\_tolerance

Capture tolerance in the negative direction of the CAD surface.

#### *property* pos\_capture\_tolerance

Capture tolerance in the positive direction of the CAD surface.

#### *property* projection\_normal

Projection direction used to map curves onto the shell mesh.

#### serialize()

Serialize to Python string.

#### *property* use\_defaults

Whether to use the offset value of the CAD Geometry.

#### *property* use\_projection\_normal

Whether to use a projection normal for outlines.

### `BooleanSelectionRule` class

#### *class* compolyx.BooleanSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

Boolean selection rule.

#### add\_rule(rule, template\_rule=False, rule\_values=(0.0, 0.0), operation\_type='intersect')

Add selection rule to boolean selection rule.

* **Parameters:**
  * **rule**: The rule to be added.
  * **template\_rule**: Whether this is a template rule.
  * **rule\_values**: Parameters of the template rule (for instance, the upper and lower limits of a ParallelSelectionRule).
  * **operation\_type**: Boolean operation type. Options:
    * `intersect`
    * `add`
    * `remove`

* **Example:**

```python theme={null}
>>> boolean_rule.add_rule(rule=model.selection_rules[‘ParallelRule.1’],template_rule=True, rule_values=(-20.0, 50.0), operation_type=’intersect’)
```

#### *property* selection\_rules

Element selection rule of the boolean selection rule.

#### serialize()

Serialize to Python string.

### `VariableOffsetSelectionRule` class

#### *class* compolyx.VariableOffsetSelectionRule(graph, obj, parent=None)

Bases: [`ElementSelectionRule`](#compolyx.ElementSelectionRule)

#### *property* angles

Link to lookup table column with taper angles.

#### *property* distance\_along\_edge

Whether to evaluate the distance along the edge or direction of the rule.

#### *property* edge\_set

Link to edge set.

#### *property* element\_set

The element set on which the rule is applied.

#### *property* inherit\_from\_lookup\_table

Whether to inherit the lookup table object properties.

#### *property* offsets

Link to lookup table column with offsets.

#### *property* radius\_direction

Direction for offset value interpolations.

#### *property* radius\_origin

Origin for offset value interpolations.

#### serialize()

Serialize to Python string.

#### *property* use\_offset\_correction

Use offset correction on mesh.

## `EntitySet` classes

### `EntitySet` class

### *class* compolyx.EntitySet(graph, obj, parent=None)

Base class for entity sets.

#### add(entity)

Add entity to the set.

#### remove(entity)

Remove entity from the set.

#### *property* size

Number of entities.

### `ElementSet` class

#### *class* compolyx.ElementSet(graph, obj=None, parent=None)

Bases: [`EntitySet`](#compolyx.EntitySet)

Element set class.

* **Exemplary usage:**
  ```python theme={null}
  >>> m=db.models.values()[-1]
  >>> eset=m.element_sets['DECK']
  >>> eset.modify(op='none')
  >>> eset.modify(op='new', element_labels=[1,2,3,4])
  >>> eset.modify(op='add', element_sets=[ m.element_sets['Deck_layup-1'] ])
  >>> eset.modify(op='intersect', x=[-6.5,-5.5])
  ```

#### *property* boundaries

Get the boundaries of the element set.

#### *property* locked

Element set is imported and cannot be changed.

#### *property* middle\_offset

Middle offset flag.

#### modify(op='new', element\_labels=None, element\_sets=None, x=None, y=None, z=None)

General method to modify the elements in an element set.

* **Parameters:**
  * **op**: Selection method. Options:
    * `new`
    * `add`
    * `remove`
    * `intersect`
    * `inverse`
  * **element\_labels**: List of element IDs.
  * **element\_sets**: List of element sets.
  * **x**: Min and max of x location.
  * **y**: Min and max of y location.
  * **z**: Min and max of z location.

#### *property* normals

Get the normals of the element set.

#### *property* orientable

`True` if the element set has an orientable topology.

#### partition()

Partitions this element set into new element sets with an orientable topology.
If this element set is already orientable, then a copy will be created.

#### *property* planar

True if the element set has a planar topology.

#### serialize()

Serialize to Python string.

#### write\_boundaries(filename, format=None)

Write boundaries in .iges/.step format.

* **Parameters:**

- **filename**: Output file.
- **format**: `iges`, `step`, or `None` (automatic format recognition).

### `EdgeSet`

#### *class* compolyx.EdgeSet(graph, obj=None, parent=None)

Edge set class.

#### *property* changed

Status boolean. Set to true if the underlying data has been changed. Write only property.

#### *property* display\_data

The edge set mesh plot.

#### *property* edge\_set\_type

Edge set type. Options: `By Reference` and `By Nodes`.

#### get\_nodes()

Return Python list with nodes as objects.

#### *property* is\_closed

Edge set is closed.

#### *property* limit\_angle

Edge set limit angle for creation of edge set by reference.

#### *property* locked

Edge set is imported and cannot be changed.

#### *property* mesh

The edge set mesh.

#### *property* node\_labels

Node labels defining the node set (only if type = `By Nodes`).

#### *property* nodes

Node indexes/labels of the edge set.

#### *property* origin

Edge set origin for createion of edge set by reference.

#### serialize()

Serialize to Python string.

## `Geometry` classes

### `CADGeometry` class

#### *class* compolyx.CADGeometry(graph, obj, visible\_sub\_shapes=None, parent=None)

#### *property* cad\_compounds

Dictionary with all compounds in the CAD Geometry.

#### *property* cad\_faces

Dictionary with all face shapes.

#### *property* cad\_solids

Dictionary with all solid shapes.

#### *property* cad\_surfaces

Dictionary with all shell shapes.

#### *property* changed

Status boolean. Set to true if the underlying data has been changed. Write only property.

#### *property* display\_data

CAD geometry mesh surface plot.

#### *property* ext\_id

External ID of the CAD geometry object.

#### *property* locked

CAD geometry is generated from an imported geometry and cannot be changed.

#### *property* normals\_display\_data

CAD geometry normals visualization.

#### *property* offset

Offset value used to analyze the surface’s coverage regarding the mesh.

#### *property* path

The file path where the CAD geometry is loaded from.

#### *property* precision

Precision of geometrical operations (intersection points, thickness sampling, …).

#### refresh\_external\_source(enforce=False)

Reload the geometry from the external source.

* **Parameters:**
  * **enforce**: Enforce the reloading of external data for locked object in the new acph5 serialization format. Pay attention when using this option.

#### *property* root\_shapes

Dictonary with all free shapes of the CAD Geometry.

#### save\_as(path)

Save the initial geometry file to the specified path.

The file extension must match the original one.

#### *property* scale\_factor

Geometry is scaled with this factor.

#### *property* shape\_type

Topological type of the shape.

#### *property* show\_normals

Visibility of face normals.

#### *property* sub\_shape\_selection\_display\_data

CAD face selection plot.

#### *property* sub\_shapes

Sub-faces of the CAD geometry.

#### *property* use\_default\_offset

Whether to use the default value.

#### *property* use\_default\_precision

Whether to use default precision value.

#### *property* visible\_sub\_shapes

IDs of CAD sub-shapes to be displayed, stored per-scene ID.

#### *property* visualization\_mesh

Visualization mesh of this geometry.

### `CADCompound` class

#### *class* compolyx.CADCompound(graph, obj, parent=None)

ComPoLyX class to represent CAD compound.

#### *property* sub\_shapes

Sub-faces of the CAD compound.

### `CADSolid` class

### *class* compolyx.CADSolid(graph, obj, parent=None)

ComPoLyX class to represent CAD solid.

#### *property* sub\_shapes

Sub-faces of the CAD solid.

### `CADShell` class

### *class* compolyx.CADShell(graph, obj, parent=None)

ComPoLyX class to represent CAD shell.

#### *property* sub\_shapes

Sub-faces of the CAD shell.

### `CADFace` class

### *class* compolyx.CADFace(graph, obj, parent=None)

ComPoLyX class to represent CAD face.

### `VirtualGeometry` class

#### *class* compolyx.VirtualGeometry(graph, obj, parent=None)

ComPoLyX class to represent virtual geometry.

#### add(shape)

Creates a new CAD reference object for the given shape. Returns the new CADReference object or the existing one if available.

* **Parameters:**
  * **shape**: A tuple where the first item is the shape object and the second the link path (root path). Only one of the two must be set.

If the first item is `None`, the link path is used to link the shape with the virtual geometry.

* **Usage:**
  ```python theme={null}
  >>> cad = db.active_model.geometry.cad_geometries['CadGeometry.1']
  >>> db.active_model.geometry.virtual_geometries['RefGeom'].add( (cad.root_shapes['top_surface'], "") )
  or
  >>> db.active_model.geometry.virtual_geometries['RefGeom'].add( (None, "CadGeometry.1/top_surface") )
  ```

#### *property* cad\_geometry

Returns the linked CAD geometry. Read only.

#### *property* cad\_references

Dictionary of all CAD references.

#### clear\_cad\_references()

Clear all linked references (virtual geometry becomes empty).

#### create\_cad\_reference(name='VirtualGeometry.1', id=None, path=None, size=None, cog=None, dimension=None, bounding\_box\_min=None, bounding\_box\_max=None)

Creates a new CAD reference and links it with the virtual geometry.

* **Parameters:**
  * **name**: Name of the object.
  * **id**: ID of the object.
  * **path**: Path of the linked CAD component. For instance “CADGeometry.1//top\_surface”.
  * **size**: Size of the linked CAD component. Size can be the volume, area or length depending on the type of the linked CAD component.
  * **cog**: Center of gravity of the linked CAD component.
  * **dimension**: The shape type of the CAD component. Options:
    * `CADCompound`
    * `CADSolid`
    * `CADShell`
    * `CADFace`
  * **bounding\_box\_min**: Minimum point of the bounding box.
  * **bounding\_box\_max**: Maximum point of the bounding box.
* **Return:**
  * The new CAD reference object.

#### *property* dimension

Highest dimension of all CAD references (3 = solid, 2 = surface, and 1 = curve).

#### remove(shape)

Removes the CAD reference object for the given shape.

* **Usage:**
  ```python theme={null}
  >>> cad = db.active_model.geometry.cad_geometries['CadGeometry.1']
  >>> db.active_model.geometry.virtual_geometries['RefGeom'].remove( (cad.root_shapes['top_surface'], "") )
  or
  >>> db.active_model.geometry.virtual_geometries['RefGeom'].remove( (None, "CadGeometry.1/top_surface") )
  ```

#### serialize()

Serialize to Python string.

#### set(shapes)

Clears the existing CAD references and creates a new one for each given shape.

* **Parameters:**
  * **shapes**: A list of tuples. The first item is the shape object and the second the link path (root path) of the shape.
* **Usage:**
  ```python theme={null}
  >>> shell = db.active_model.geometry.cad_geometries['CADGeometry.1'].root_shapes['cut_surface']
  >>> db.active_model.geometry.virtual_geometries['RefGeom.1'].set(shapes=[ (shell, "") ] )
  or
  >>> db.active_model.geometry.virtual_geometries['RefGeom.1'].set(paths=[ (None, "CADGeometry.1/cut_surface") ] )
  ```

#### *property* sub\_shapes

Sub-components of the virtual geometry.

### `CADReference` class

#### *class* compolyx.CADReference(graph, obj, parent=None)

ComPoLyX class to represent CAD reference.

#### *property* bounding\_box\_max

Maximum of the bounding box.

#### *property* bounding\_box\_min

Minimum of the bounding box.

#### *property* cog

Center of gravity of the linked shape.

#### *property* dimension

Dimension of the linked shape (1 for lines, 2 for surfaces, and 3 for solids).

#### *property* path

Path to the linked CAD component. For instance, ‘CADGeometry.1//top\_surface’. Note, ‘/’ was used as separator before 2024 R2.

#### *property* size

Size of the linked CAD shape.

#### *property* status

Status of the CAD reference.

## `OrientedSelectionSet` class

#### *class* compolyx.OrientedSelectionSet(graph, obj, parent=None)

Class to represent oriented selection set.

#### add\_element\_set(element\_set)

Add element set to oriented selection set.

#### add\_rosette(rosette)

Add rosette to oriented selection set.

#### add\_selection\_rule(rule)

Add selection rule to oriented selection set.

#### *property* auto\_draping\_direction

Automatic selection of draping direction.

#### *property* boundaries

Get the boundaries of the oriented selection set.

#### clear\_element\_sets()

Clear element sets of oriented selection set.

#### clear\_rosettes()

Clear rosettes of oriented selection set.

#### clear\_selection\_rules()

Clear selection rules of oriented selection set.

#### *property* draping

Flag for using draping.

#### *property* draping\_direction

The direction in which the draping starts.

#### *property* draping\_material\_model

Draping material model.

#### *property* draping\_mesh\_size

The mesh size for draping.

#### *property* draping\_obj

Draping representation.

#### *property* draping\_seed\_point

The seed point where the draping starts.

#### *property* draping\_ud\_coefficient

UD draping coefficient.

#### *property* element\_sets

Element sets of the oriented element set.

#### *property* elements

Elements of the oriented selection set.

#### normal\_from\_id(id)

Returns the element normal.

#### *property* normals

Get the normals of the oriented selection set.

#### *property* orientation\_direction

The orientation direction of the oriented selection set.

#### *property* orientation\_point

The orientation point of the oriented selection set.

#### *property* orientations

Get the oriented normals of the oriented selection set.

#### *property* ref\_directions

Get the refernce directions of the oriented selection set.

#### *property* reference\_direction\_field

A lookup table column or None for external reference directions.

#### remove\_element\_set(element\_set)

Remove element set from oriented selection set.

#### remove\_rosette(rosette)

Remove rosette from oriented selection set.

#### remove\_selection\_rule(rule)

Remove rule from oriented selection set.

#### *property* rosette\_selection\_method

Selection method for rosettes of the oriented selection set.

#### *property* rosettes

Rosettes of the oriented selection set.

#### *property* rotation\_angle

Angle to rotate the reference directions around the orientation directions (in degree).

#### save\_flat\_wrap(filename)

Write the flatwrap to .dxf, .iges, or .step file.

* **Parameters:**
  * **filename**: Path to the file to be written.

#### *property* selection\_rules

Selection rules of the oriented selection set.

#### serialize()

Serialize to Python string.

#### *property* use\_default\_draping\_mesh\_size

Whether to use a default size for the draping mesh.

#### write\_boundaries(filename, format=None)

Write boundaries in .iges/.step format.

* **Parameters:**

- **filename**: Output file.
- **format**: `iges`, `step`, or `None` (automatic format recognition).

## `ModelingGroup` class

#### *class* compolyx.ModelingGroup(graph, obj, parent=None)

Class to manage modeling groups.

* **Access:**

```python theme={null}
>>> import compolyx
>>> db = compolyx.DB()
>>> model = db.models['class40.1']
>>> mpg = model.modeling_groups['PlyGroup.1']
```

Creation:

```python theme={null}
>>> import compolyx
>>> db = compolyx.DB()
>>> model = db.models['class40.1']
>>> mpg_1 = model.create_modeling_group('PlyGroup.1')
```

#### copy\_butt\_joint\_sequence(source, global\_ply\_nr=None, sort=True)

Makes a copy of a butt-joint sequence.

* **Parameters:**
  * **source**: Source object to copy.
  * **global\_ply\_nr**: Global ply number to use. If `0`, then the ply is added at the top.
  * **sort**: Whether to sort all plies of modeling group after copy.
    If multiple plies are copied at once it can be useful to sort only once at the end of the copy operation.
* **Returns:**
  New instance of modeling ply.

#### copy\_interface\_layer(source, global\_ply\_nr=None, sort=True)

Copy an interface layer.

* **Parameters:**
  * **source**: Source object to copy.
  * **global\_ply\_nr**: Global ply number to use. If `0`, then the ply is added at the top.
  * **sort**: Whether to sort all plies of interface layer group after copy.
    If multiple plies are copied at once it can be useful to sort only once at the end of the copy operation.
* **Returns:**
  New instance of interface layer.

#### copy\_modeling\_ply(source, global\_ply\_nr=None, sort=True)

Copy a modeling ply.

* **Parameters:**
  * **source**: Source object to copy.
  * **global\_ply\_nr**: Global ply number to use. If `0`, then the ply is added at the top.
  * **sort**: Whether to sort all plies of modeling group after copy.
    If multiple plies are copied at once it can be useful to sort only once at the end of the copy operation.
* **Returns:**
  New instance of modeling ply.

#### create\_butt\_joint\_sequence(name=None, id=None, global\_ply\_nr=None, primary\_plies=None, secondary\_plies=None, active=True)

Creates a new butt-joint sequences and adds it to this modeling group.

* **Parameters:**
  * **name**: Name of the butt-joint.
  * **id**: ID of the name.
  * **global\_ply\_nr**: Global ply number which orders the ply sequences.
  * **primary\_plies**: List of tuples (modeling ply, level). Define the source of the thickness between plies.
  * **secondary\_plies**: Single or list of modeling plies. Secondary plies inherit the thickness from the primary plies.
  * **active**: Boolean for whether the butt-joint sequence is active.
* **Return:**
  New butt-joint sequence.

#### create\_interface\_layer(name=None, id=None, global\_ply\_nr=None, oriented\_selection\_sets=None, open\_area\_sets=None, active=True)

Create an iterface layer.

* **Parameters:**
  * **name**: Name of the new iterface layer.
  * **id**: Optional ID of the new iterface layer.
  * **global\_ply\_nr**: Ply number for stacking sequence.
  * **oriented\_selection\_sets**: Oriented selection set for the expansion of the iterface layer.
  * **open\_area\_sets**: Defines the initial crack of a VCCT layer (optional).
  * **active**: Iterface layer active (default: `True`).
* **Returns:**
  The created iterface layer.
* **Example:**
  ```python theme={null}
  >>> oes_1 = model.oriented_selection_sets['OrientedSelectionSet.1']
  >>> mpg = model.modeling_groups['PlyGroup.1']
  >>> mp_1 = mpg.create_interface_layer( name='InterfaceLayer.1',
                                    global_ply_nr=0,
                                    oriented_selection_sets=(oes_1,),
                                    active=True)
  ```

#### create\_modeling\_ply(name=None, id=None, ply\_material=None, ply\_angle=0.0, number\_of\_layers=1, global\_ply\_nr=None, oriented\_selection\_sets=None, selection\_rules=None, draping='no\_draping', draping\_seed\_point=None, auto\_draping\_direction=True, draping\_thickness\_correction=True, draping\_direction=None, draping\_mesh\_size=0.0, use\_default\_draping\_mesh\_size=True, thickness\_definition='nominal', core\_geometry=None, active=True, taper\_edges=None, thickness\_field=None, thickness\_field\_type='absolute', angle\_1\_field=None, angle\_2\_field=None)

Create modeling ply.

* **Parameters:**
  * **name**: Name of the new modeling ply.
  * **id**: Optional ID of the new modeling ply.
  * **ply\_material**: Ply Material (Fabric, Stackup, SubLaminate).
  * **ply\_angle**: Angle of the ply material.
  * **number\_of\_layers**: Multiplier of this layer.
  * **global\_ply\_nr**: Ply number for stacking sequence.
  * **oriented\_selection\_sets**: Oriented selection set for the expansion of the modeling ply.
  * **selection\_rules**: Element selection rules for the modeling ply.
  * **draping**: The type of draping to be used. Options:
    * `no_draping`
    * `evaluate_draping`
    * `tabular_values`
  * **draping\_seed\_point**: Start/seed point for draping.
  * **auto\_draping\_direction**: Automatically set draping direction (default: `True`).
  * **draping\_direction**: Direction to go in draping (default: `None`).
  * **draping\_mesh\_size**: Mesh size used for draping.
  * **use\_default\_draping\_mesh\_size**: Whether to use a default size for the draping mesh. Default is the average element size of the shell mesh.
  * **thickness\_definition**: Enum that describes the method used for thickness definition (default: `Nominal`).
  * **core\_geometry**: The assigned core geometry.
  * **active**: Modeling ply active.
  * **taper\_edges**: Taper Edges for the modeling ply.
  * **thickness\_field**: Lookup table column with scalar values for thickness sampling (optional).
  * **thickness\_field\_type**: The type of thickness field. Options:
    * `absolute`
    * `relative`
  * **angle\_1\_field**: Lookup table column with scalar values for angle 1.
  * **angle\_2\_field**: Lookup table column with scalar values for angle 2.
* **Returns:**
  The created modeling ply.
* **Example:**
  ```python theme={null}
  >>> oes_1 = model.oriented_selection_sets['OrientedSelectionSet.1']
  >>> fabric_1 = model.material_data.fabrics['Fabric.1']
  >>> mpg = model.modeling_groups['PlyGroup.1']
  >>> mp_1 = mpg.create_modeling_ply( name='ModelingPly.1',
                                      ply_angle=0.0,
                                      global_ply_nr=0,
                                      number_of_layers=1,
                                      ply_material=fabric_1,
                                      oriented_selection_sets=(oes_1,),
                                      selection_rules=(rule1,),
                                      draping="no_draping",
                                      draping_seed_point = (1,0,0),
                                      auto_draping_direction = True)
  ```

#### export\_ply\_geometries(filename, ply\_level='production\_ply', boundary=True, surface=True, offset\_type='middle\_offset', direction\_arrows=False, first\_direction=True, second\_direction=False, arrow\_length=1.0, arrow\_type='no\_arrow')

Exports the surface, boundary, and/or fiber directions of modeling, production, and analysis ply to .igs or .step file.

* **Parameters:**
  * \`**filename**: File path. Extensions:
    * .iges
    * .igs
    * .step
    * .stp
  * **ply\_level**: Defines which plies are exported:
    * `modeling_ply_wise`
    * `production_ply_wise` (default)
    * `analysis_ply_wise`
  * **boundary**: Boolean whether to export the boundary (default: `True`).
  * **surface**: Boolean whether to export the ply surface (default: `True`).
  * **offset\_type**: Offset type. Options:
    * `no_offset`
    * `middle_offset` (default)
    * `top_offset`
    * `bottom_offset`
  * **direction\_arrows**: Boolean whether to export the direction arrows. Default is `False`.
  * **first\_direction**: Boolean whether to export the first (main) material direction (default: `True`).
  * **second\_direction**: Boolean whether to export the second material direction (default: `False`).
  * **arrow\_length**: Length of the arrows (default: `1`).
  * **arrow\_type**: Defines the arrow type. Options:
    * `standard_arrow`
    * `no_arrow` (default)
    * `half_arrow`

#### *property* plies

Modeling plies of the modeling group.

#### reorder\_plies(source, target, option='after')

Reorder the ply group. Take source plies and insert before/after target ply. If the ModelingGroup itself is
specified as a target, then the modeling plies retain their original global ply number.

* **Parameters:**
  * **source**: List of plies to insert at new position.
  * **target**: Position to insert plies. Options are modeling group and sequence entity.
  * **option**: Where to insert: `after` (default), `before`, `end` (for SequenceEntity targets), or `keep` (for
    ModelingGroup targets).
    * `after`: Paste right after the target.
    * `before`: Paste right before the target.
    * `end`: Paste at the end of the ModelingGroup containing target.
    * `keep`: Keep the previous global\_ply\_nr (only works for move, and when target is a ModelingGroup).

#### serialize(butt\_joints=False)

Serialize to Python string.

* **Parameters:**
  * **butt\_joints**: Specify whether butt-joints are serialized or everything else (modeling group, modeling plies, and interface layers).

## `ModelingPly` class

#### *class* compolyx.ModelingPly(graph, obj, parent=None, element\_vd=None)

Class to represent modeling ply.

#### add\_oriented\_selection\_set(oriented\_selection\_set)

Add oriented selection set.

* **Parameters:**
  * **oriented\_selection\_set**: The oriented selection set to be assigned to modeling ply.

#### add\_selection\_rule(rule, template\_rule=False, rule\_values=(), operation\_type='intersect')

Add rule to modeling ply.

* **Parameters:**
  * **rule**: The rule to be added to the modeling ply.
  * **template\_rule**: Boolean.
  * **rule\_values**: Parameters of the template rule.
  * **operation\_type**: Boolean operation type (`intersect`, `add`, or `remove`).

#### add\_taper\_edge(taper\_edge, angle, offset=0.0)

Add taper edge to modeling ply.

* **Parameters:**
  * **taper\_edge**: The taper edge to be added to the modeling ply.
  * **angle**: Angle for tapering.
  * **offset**: Offset for tapering.

#### *property* angle\_1\_field

Angle 1 correction field.

#### *property* angle\_2\_field

Angle 2 correction field.

#### *property* area

Area of the modeling ply.

#### *property* auto\_draping\_direction

Automatic selection of draping direction.

#### clear\_oriented\_selection\_sets()

Clear all oriented selection sets of the modeling ply.

#### clear\_selection\_rules()

Clear all selection\_rules assigned to the modeling ply.

#### clear\_taper\_edges()

Clear all taper\_edges assigned to the modeling ply.

#### *property* core\_geometry

Assigned core geometry.

#### direction\_arrows(arrow\_length=None, arrow\_type='standard\_arrow', offset\_type='no\_offset')

Direction arrows of the ply.

* **Parameters:**
  * **arrow\_length**: Length of the arrow.
  * **arrow\_type**: Arrow type. Options:
    * `standard_arrow` (default)
    * `no_arrow`
    * `half_arrow`
  * **offset\_type**: Offset type. Options:
    * `no_offset` (default)
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`

#### *property* draped\_fiber\_directions

Get the draped fiber directions of the modeling ply.

#### *property* draping

Type of draping to be used.

#### *property* draping\_direction

The direction in which the draping starts.

#### draping\_direction\_from\_calculation(analysis\_ply=None)

Draping direction used for draping calculation.

#### *property* draping\_mesh\_size

The mesh size for draping.

#### *property* draping\_obj

Draping properties of the modeling ply.

#### *property* draping\_seed\_point

The seed point where the draping starts.

#### draping\_seed\_point\_from\_calculation(analysis\_ply=None)

Draping seed point used for draping calculation.

#### *property* draping\_thickness\_correction

Thickness correction for draping.

#### element\_normal\_is\_equal(element\_id=None, normal=None)

Returns 1 if the element normal is equal the orientation of the modeling ply, else -1.

* **Parameters:**
  * **element\_id**: Element label.
  * **normal**: Reference normal direction.

#### *property* fiber\_directions

Get the fiber directions of the modeling ply.

#### *property* number\_of\_layers

Number of layers of the modeling ply.

#### *property* on\_sampling\_point

Flag if the modeling ply is on sampling point.

#### orientation\_at\_element(element\_id=None)

Returns the orientation of this modeling ply for a certain element.
If the element does not belong to the modeling ply, then the return value is \[0,0,0].

* **Parameters:**
  * element\_id: Element label.

#### *property* orientations

Get the oriented normals of the modeling ply.

#### *property* oriented\_selection\_sets

Oriented selection sets of the modeling ply.

#### *property* ply\_angle

Ply angle of the modeling ply.

#### *property* ply\_offsets

Get the offsetted modeling ply.

#### *property* price

Price of the modeling ply.

#### *property* production\_plies

Production plies of the modeling ply.

#### *property* ref\_directions

Get the reference directions of the modeling ply.

#### remove\_oriented\_selection\_set(oriented\_selection\_set)

Remove oriented selection set from modeling ply.

* **Parameters:**
  * **oriented\_selection\_set**: The oriented selection set to be removed from modeling ply.

#### remove\_selection\_rule(rule)

Remove rule from modeling ply.

* **Parameters:**
  * **rule**: The rule to be removed from modeling ply.

#### remove\_taper\_edge(taper\_edge)

Remove taper\_edge from modeling ply.

* **Parameters:**
  * **taper\_edge**: The taper\_edge to be removed from modeling ply.

#### *property* selection\_rules

Element selection rule of the modeling ply.

#### serialize()

Serialize to Python string.

#### *property* taper\_edges

Taper edges of the modeling ply.

#### *property* thickness\_definition

Type-of-thickness definition to be used.

#### *property* thickness\_field

Lookup table column with tabular thicknesses or None.

#### *property* thickness\_field\_type

The type of the thickness field (`absolute` or `relative`).

#### *property* use\_default\_draping\_mesh\_size

Enable this property to use a default size for the draping mesh.

#### *property* weight

Weight of the modeling ply.

#### write\_boundaries(filename, format=None, offset\_type='no\_offset', with\_direction\_arrows=False, arrow\_length=None, arrow\_type='standard\_arrow')

Write boundaries in iges/step format.

* **Parameters:**
  * **filename**: Output file.
  * **format**: Format options:
    * `iges`
    * `step`
    * `None` (automatic format recognition)
  * **offset\_type**: Offset type. Options:
    * `no_offset` (default)
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`
  * **with\_direction\_arrows**: The element directions should be written to.
  * **arrow\_length**: Length of the direction arrows (default is average element edge size).
  * **arrow\_type**: Type to be used as arrows. Options:
    * `standard_arrow` (default)
    * `no_arrow`
    * `half_arrow`

## `ProductionPly` class

#### *class* compolyx.production\_ply.ProductionPly(graph, obj, parent=None, element\_vd=None)

Class to represent production ply.

#### *property* analysis\_plies

Analysis plies of the production ply.

#### *property* angle

Ply angle of the production ply.

#### *property* area

Area of the production ply.

#### *property* const\_thickness

True if this production ply has a constant thickness.

#### direction\_arrows(arrow\_length=None, arrow\_type='standard\_arrow', offset\_type='no\_offset')

Direction arrows of the ply.

* **Parameters:**
  * **arrow\_length**: Length of the arrow.
  * **arrow\_type**: Arrow type. Options:
    * `standard_arrow` (default)
    * `no_arrow`
    * `half_arrow`
  * **offset\_type**: Offset type. Options:
    * `no_offset` (default)
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`

#### *property* draping\_obj

Draping representation.

#### *property* ply\_material

Ply material of the production ply.

#### *property* price

Price of the production ply.

#### save\_draping\_input\_data(filename)

Writes out modeling ply to draping interface fle.

* **Parameters:**
  * `filename`: Path to the file to be written.

#### save\_flat\_wrap(filename)

Write the flatwrap to .dxf, .iges, or .step file.

* **Parameters:**
  * **filename**: Path to the file to be written.

#### *property* thickness

Thickness of the production ply.

#### update()

Update the production ply.

#### *property* weight

Weight of the production ply.

#### write\_boundaries(filename, format=None, offset\_type='no\_offset', with\_direction\_arrows=False, arrow\_length=None, arrow\_type='standard\_arrow')

Write boundaries in .iges/.step format.

* **Parameters:**
  * **filename**: Output file.
  * **format**: Format options:
    * `iges`
    * `step`
    * `None` (automatic format recognition)
  * **offset\_type**: Offset type. Options:
    * `no_offset` (default)
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`
  * **with\_direction\_arrows**: The element directions should be written to.
  * **arrow\_length**: Length of the direction arrows (default is average element edge size).
  * **arrow\_type**: Type to be used as arrows. Options:
    * `standard_arrow` (default)
    * `no_arrow`
    * `half_arrow`

## `AnalysisPly` class

#### *class* compolyx.AnalysisPly(graph, obj, parent=None)

ComPoLyX class to represent analysis ply.

#### *property* active

Sequence entity is active.

#### *property* active\_in\_post\_mode

True if failure criteria will be processed for this ply.

#### *property* angle

Ply angle of the analysis ply.

#### direction\_arrows(arrow\_length=None, arrow\_type='standard\_arrow', offset\_type='no\_offset')

Direction arrows of the ply.

* **Parameters:**
  * **arrow\_length**: Length of the arrow.
  * **arrow\_type**: Arrow type. Options:
    * `standard_arrow` (default)
    * `no_arrow`
    * `half_arrow`
  * **offset\_type**: Offset type. Options:
    * `no_offset` (default)
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`

#### *property* draping\_obj

Get the fiber directions of the analysis ply.

#### is\_reinforcing()

True if the analysis ply is a reinforcing ply.

For instance, if linked to a layup mapping object of type `reinforcing` or
to an imported solid model via a mapping object of type `reinforcing`.

#### *property* material

Ply material of the analysis ply.

#### *property* mesh

Mesh. Only available if analysis ply is reinforcement.

#### *property* ply\_material

Ply material of the analysis ply.

#### *property* thickness

Thickness of the analysis ply.

#### update()

Update the analysis ply.

#### write\_boundaries(filename, format=None, offset\_type='no\_offset', with\_direction\_arrows=False, arrow\_length=None, arrow\_type='standard\_arrow')

Write boundaries in .iges/.step format.

* **Parameters:**
  * **filename**: Output file.
  * **format**: Format options:
    * `iges`
    * `step`
    * `None` (automatic format recognition)
  * **offset\_type**: Offset type. Options:
    * `no_offset` (default)
    * `bottom_offset`
    * `middle_offset`
    * `top_offset`
  * **with\_direction\_arrows**: The element directions should be written to.
  * **arrow\_length**: Length of the direction arrows (default is average element edge size).
  * **arrow\_type**: Type to be used as arrows. Options:
    * `standard_arrow` (default)
    * `no_arrow`
    * `half_arrow`

## `InterfaceLayer` class

#### *class* compolyx.InterfaceLayer(graph, obj, parent=None)

Class to represent interface layer.

#### add\_open\_area\_set(value)

Add open area set to interface layer.

#### add\_oriented\_selection\_set(oriented\_selection\_set)

Add oriented selection set.

* **Parameters:**
  * **oriented\_selection\_set**: The oriented selection set to be assigned to interface layer.

#### clear\_open\_area\_sets()

Clears the open area selection.

#### clear\_oriented\_selection\_sets()

Clear all oriented selection sets of the interface layer.

#### *property* enabled

Whether this object is currently enabled.

#### *property* open\_area\_sets

Open area set(s) of the interface layer.

#### *property* oriented\_selection\_sets

Oriented selection sets of the interface layer.

#### *property* ply\_offsets

Get the offsetted interface layer.

#### remove\_open\_area\_set(value)

Remove open area set from interface layer.

#### remove\_oriented\_selection\_set(oriented\_selection\_set)

Remove oriented selection set from interface layer.

* **Parameters:**
  * **oriented\_selection\_set**: The oriented selection set to be removed from interface layer.

#### serialize()

Serialize to Python string.

## `ButtJointSequence` class

#### *class* compolyx.ButtJointSequence(graph, obj, parent=None)

Class to represent the butt-joint sequence.

#### *property* primary\_plies

Primary plies of the butt-joint squence.

#### *property* secondary\_plies

Secondary plies of the butt-joint squence.

#### serialize()

Serialize to Python string.

## `ImportedModelingGroup` class

#### *class* compolyx.ImportedModelingGroup(graph, obj, parent=None)

#### copy\_imported\_modeling\_ply(source)

Copy an imported modeling ply.

* **Parameters:**
  * **source**: Source object to copy.
* **Returns:**
  New instance of imported modeling ply.

#### create\_imported\_modeling\_ply(name=None, id=None, active=True, offset='bottom', ply\_material=None, ply\_angle=0.0, mesh\_import\_type='from\_geometry', mesh\_geometry=None, rosette\_selection\_method='minimum\_angle', rosettes=\[], thickness\_definition='nominal', thickness\_field=None, thickness\_field\_type='absolute', draping='no\_draping', angle\_1\_field=None, angle\_2\_field=None, rotation\_angle=0.0)

Create modeling ply.

* **Parameters:**
  * **name**: Name of the new imported modeling ply.
  * **id**: Optional ID of the new imported modeling ply.
  * **active**: Whether the ply is active.
  * **offset**: whether the mesh defines the bottom, middle, or top surface of the ply.
  * **ply\_material**: Ply material (fabric).
  * **ply\_angle**: Angle of the ply material.
  * **mesh\_import\_type**: The source of the imported mesh (`from_h5_composite_cae` or `from_geometry`).
  * **mesh\_geometry**: If mesh\_import\_type is from\_geometry, then this geometry defines the surface of the ply.
  * **rosette\_selection\_method**: Method to calculate element orientation. Options:
    * `minimum_angle`
    * `maximum_angle`
    * `minimum_distance`
    * `minimum_angle_superposed`
    * `minimum_distance_superposed`
    * `maximum_angle_superposed`
    * `ansys_classic`
    * `tabular_values`
  * **rosettes**: Rosettes for the imported modeling ply.
  * **reference\_direction\_field**: Table column used to compute reference directions. Only needed if **rosette\_selection\_method** = `tabular_values`.
  * **thickness\_definition**: Enum that describes the method used for thickness definition (the default is nominal).
  * **thickness\_field**: Lookup table column with scalar values for thickness sampling (optional).
  * **thickness\_field\_type**: The type of thickness field (`absolute` or `relative`).
  * **draping**: The type of draping to be used (`no_draping` or `tabular_values`).
  * **angle\_1\_field**: Lookup table column with scalar values for angle 1.
  * **angle\_2\_field**: Lookup table column with scalar values for angle 2.
  * **rotation\_angle**: Angle to rotate the reference directions (in degree).
* **Returns:**
  The created imported modeling ply.
* **Example:**
  ```python theme={null}
  >>> modeling_group = db.active_model.create_imported_modeling_group( name='ImportedModelingGroup' )
  >>> modeling_group.create_imported_modeling_ply(name='ImportedModelingPly.1', offset='middle', ply_angle=45)
  ```

#### *property* plies

Modeling plies of the modeling group.

## `ImportedModelingPly` class

#### *class* compolyx.ImportedModelingPly(graph, obj, parent=None)

#### *property* active

Whether the ply is active or surpressed.

#### *property* angle\_1\_field

Angle 1 correction field.

#### *property* angle\_2\_field

Angle 2 correction field.

#### clear\_rosettes()

Clear rosettes of imported modeling ply.

#### *property* draping

Type of draping to be used.

#### *property* mesh

#### *property* mesh\_geometry

Geometry that defines the mesh/surface of this ply.

#### *property* mesh\_import\_type

Defines the source of the imported mesh.

#### *property* offset

Defines whether the imported mesh defines the bottom, middle or top surface of the ply.

#### *property* ply\_angle

Ply Angle of the imported modeling ply.

#### *property* ply\_material

Material of the modeling ply.

#### *property* production\_plies

Attached imported production plies.

#### *property* reference\_direction\_field

a lookup table column or None for external reference directions.

#### *property* rosette\_selection\_method

Defines the rosette selection method.

#### *property* rosettes

Rosettes of the imported modeling ply.

#### *property* rotation\_angle

Angle to rotate the reference directions (in degree).

#### *property* thickness\_definition

Type-of-thickness definition to be used (from table, nominal).

#### *property* thickness\_field

LookUpTable Column with tabular thicknesses or None.

#### *property* thickness\_field\_type

The type of the thickness field (`absolute` or `relative`).

## `ImportedProductionPly` class

#### *class* compolyx.ImportedProductionPly(graph, obj, parent=None)

#### *property* analysis\_plies

Analysis plies of the production ply.

#### *property* angle

Ply angle of the production ply.

#### *property* mesh

#### *property* ply\_material

Ply material of the production ply.

#### *property* thickness

Thickness of the production ply.

## `ImportedAnalysisPly` class

#### *class* compolyx.ImportedAnalysisPly(graph, obj, parent=None)

Class to represent an imported modeling ply.

#### *property* active\_in\_post\_mode

Whether ply is active in ACP (Post).

#### *property* angle

Ply angle.

#### is\_reinforcing()

True if the analysis ply is a reinforcing ply.

For instance, if linked to a layup mapping object of type `reinforcing` or
to an imported solid model via a mapping object of type `reinforcing`.

#### *property* material

Ply material.

#### *property* mesh

#### *property* thickness

Average ply thickness.

## `FieldDefinition` class

#### *class* compolyx.FieldDefinition(graph, obj, parent=None)

Class to represent field definition.

#### *property* active

Field definition is active.

#### *property* enabled

Whether this object is currently enabled. Mainly defined through the current application mode pre or post.

#### *property* field\_variable\_name

The name of the field variable defined.

#### *property* full\_mapping

Whether the field is interpolated to the shell reference surface or to the actual ply-position by taking into account the shell offset. In solid models, the interpolation takes always place at the actual ply position.

#### *property* locked

Returns the locked status of the field definition.

#### *property* scalar\_field

Lookup table column used with this field definition.

#### *property* scope\_entities

The entities defining the scope of the field definition. Options:

* Element sets
* Modeling plies
* Oriented selection sets

#### serialize()

Serialize to Python string.

## `SamplingPoint` class

#### *class* compolyx.SamplingPoint(graph, obj, parent=None)

The sampling point enables picking through the laminate at a certain point to run detailed analyses.

* **Key features:**
  * Layup in the object tree of the closest element to the selected point.
  * Sampling direction defines the ply order (bottom-up or top-down).
  * Reference direction defines the 0 degree axis of the element used for the evaluations (CLT).
  * Optional a user-defined coordinate system can be selected to compute the reference direction. The element normal and reference direction.
    defines the result coordinate system.
  * 2D plots showing the layup, stress, strain and failure distribution through the laminate.
  * Polar plot of the laminate properties.
  * Analysis based on the Classical Laminate Theory (CLT).
  * Export to ESAComp, CSV file, etc.

* **Usage:**
  ```python theme={null}
  >>> model.create_sampling_point(name='Sampling Point')
  ```

#### aligned()

Returns true if the sampling direction is aligned with the normal direction of the closest element.

#### capture\_analysis\_plot(path=None, size=(800, 600))

Saves the sampling point analysis plot to a file.

Note that this function only works when executed from a GUI, or
in batch mode with a hidden GUI. It does not work in full batch
mode.

* **Parameters:**
  * **path**: Path of the produced image file.
  * **size**: Pixel size of the plot.

#### clt\_query(query='layup', offset\_is\_middle=True, consider\_coupling\_effect=True)

Returns the properties of the classical laminate theory:

* **Parameters:**
  * **query**: Query parameter (see below).
  * **offset\_is\_middle**: Whether to offset the reference surface to the mid-plane of the laminate. This has an influence on the laminate stiffness calculations.
  * **consider\_coupling\_effect**: Whether to consider the coupling effect (B-Matrix). It is only of relevance for the laminate engineering constants.

* **Options:**
  * **layup**: Returns the layup of the laminate (modeling, production, and analysis plies). This is the default.
  * **laminate\_properties**: Young’s, flexural, and shear moduli of the laminate.
  * **polar\_properties**: E1, E2, and G12 depending on the laminate orientation.
  * **text\_labels**: Returns a list with the material names, angles, and thicknesses.
  * **stiffness\_matrix**: Returns the laminate stiffness matrix (ABD).
  * **compliance\_matrix**: Returns the lamiante compliance matrix (inverse of ABD).
  * **laminate\_forces**: Returns a dict with the laminate forces Nx, Ny, Nxy, Mx, My, Mxy, Qx, and Qy. Offset is middle is always true for this evaluation.

* **Usage:**

```python theme={null}
  >>> se.clt_query(query='polar_properties')
```

#### *property* consider\_coupling\_effect

Whether to consider coupling effects (B-Matrix) for the calculation of the laminate engineering constants. The computation of the ABD matrices is not affected by this parameter.

#### create\_plot(query=\{'layup': \['mp'], 'polar\_properties': \['E1', 'G12']}, offset\_is\_middle=True, consider\_coupling\_effect=True)

Generates 2D plots with the results of interest.

* **Parameters:**
  * **query**: Query parameter.
  * **offset\_is\_middle**: Whether to offset the reference surface to the mid-plane of the laminate. This has an influence on the laminate stiffness calculations.
  * **consider\_coupling\_effect**: Whether to consider the coupling effect (B-Matrix). It is only of relevance for the laminate engineering constants.
* **Options:**
  * **layup**: \[`mp`, `pp`, `ap`] Modeling Plies, Production Plies and Analysis Plies.
  * **polar\_properties**: \[`E1`, `E2`, `G12`] Polar plot of laminate stiffesses.
  * **strains**: \[`e1`, `e2`, `e3`, `e12`, `e13`, `e23`, `eI`, `eII`, `eIII`] Strain definition name and component.
  * **stresses**: \[`s1`, `s2`, `s3`, `s12`, `s13`, `s23`, `sI`, `sII`, `sIII`] Stress definition name and component.
  * **failures**: \[`FailureCriteria.1_irf`, `FailureCriteria.1_rf`, `FailureCriteria.1_mos`, `FailureCriteria.1_fm`] Name of FC and value.
  * **text\_labels**: \[`material`, `angle`, `thickness`]
* **Usage:**
  ```python theme={null}
  >>> se.create_plot(query={layup:['mp'], failure:['FailureCriteria.1_irf']}
  >>> se.graph_plot.x_values
  >>> se.graph_plot.layer_thicknesses
  ```

#### *property* direction

Sampling point direction.

#### *property* element\_id

Element ID (label) of the sampling point.

#### *property* enabled

Whether this object is currently enabled. Sampling points are always enabled.

#### *property* graph\_plot

Graph plot object used to configure 2D plots.

#### *property* locked

Sampling point is generated from an imported source and cannot be changed.

#### *property* offset\_is\_middle

Whether to offset the reference surface to the mid-plane of the laminate.

#### *property* plies

Plies of the sampling point.

#### *property* point

Sampling point.

#### *property* reference\_direction

Reference direction.

#### *property* rosette

Rosette of the sampling point.

#### *property* solution\_set

Solution and set selection.

#### update\_plot(offset\_is\_middle, consider\_coupling\_effect)

Updates the 2D plot.

* **Parameters:**
  * **offset\_is\_middle**: Whether to offset the reference surface to the mid-plane of the laminate. This has an influence on the laminate stiffness calculations.
  * **consider\_coupling\_effect**: Whether to consider the coupling effect (B-Matrix). It is only of relevance for the laminate engineering constants.

#### *property* use\_default\_reference\_direction

Flag to use default reference direction.

## `SectionCut` class

#### *class* compolyx.SectionCut(graph, obj, parent=None, color\_table=None)

Section cut class showing the layup in the cutting plane.

#### *property* active

Whether a section cut is computed on update.

#### *property* changed

Status boolean. Set to true if the underlying data has been changed. Write only property.

#### compute\_equivalent\_beam\_properties(check\_status=True, solver\_exe\_path=None)

Compute the equivalent beam properties of the section cut.

The section is exported to Mechanical APDL and solved based on G.L.Ghiringhelli’s paper "LINEAR, STRAIGHT AND UNTWISTED ANISOTROPIC BEAM SECTION PROPERTIES
FROM SOLID FINITE ELEMENTS". For more details, see the ACP documentation.

* **Parameters:**
  * **check\_status**: Set to `True` to throw an exception if the computation failed. Otherwise, use SectionalAnalysisOutputs.status to check if the computation failed.
  * **solver\_exe\_path**: The path to the Mechanical APDL solver executable. If not provided, the default solver is used.

* **Returns:**
  SectionalAnalysisOutputs. The equivalent beam properties are stored under properties.

* **Usage:**

```python theme={null}
>>> result = section_cut.compute_equivalent_beam_properties(check_status=False)
>>> if result.status == “completed”:
>>>     print(result.properties)
>>> else:
>>>     print(f”MAPDL output:

{result.mapdl_out_file}”)
  >>>     print(f"Result file:

{result.sectional_result_file}”)
```

#### *property* core\_scale\_factor

Get/set the core scale factor.

#### *property* display\_data

Section cut plots.

#### *property* elastic\_measures

Cross-sectional measures of elasticity.

#### *property* element\_labels

Label of elements within ex1 array.

#### *property* element\_nodes

Coincidence list.

#### *property* element\_types

Element types within ex1 array.

#### *property* enabled

Whether this object is currently enabled. Section cuts are always enabled.

#### export\_surface\_section\_cut(path, format='becas:in', export\_strength\_limits=True, mapdl\_model\_type='mesh\_only')

Exports the suface section cut to BECAS or ANSYS Mechanical APDL.

* **Paramters:**
  * **path**: File path or directory depending on the export format.
  * **format**: Export format. Implemented are `becas:in` (default) and `ansys:cdb`.
  * **export\_strength\_limits**: Whether to export the strength limits for BECAS (default is `True`). Ignored if the format is not `becas:in`.
  * **mapdl\_model\_type**: (String) The type of the model to be exported to ANSYS Mechanical APDL. Ignored if the format is not `ansys:cdb`.
    * `mesh_only`: Only the mesh (including elements and nodes) is exported. This is the default.
    * `solid_model`: The section cut is expanded into a slice of solid elements.
      In addition, the material properties are exported and the element coordinate systems
      are alinged with the fiber direction. This model can be used to compute the equivalent
      beam properties of the section cut.
* **Usage:**
  ```python theme={null}
  >>> section_cut.export_surface_section_cut(r'D:\tmp\section_cut.cdb', 'ansys:cdb', mapdl_model_type='mesh_only')
  >>> section_cut.export_surface_section_cut(r'D:\tmp\section_cut.cdb', 'ansys:cdb', mapdl_model_type='solid_model')
  >>> section_cut.export_surface_section_cut(path=r'D:\tmp', format='becas:in', export_strength_limits=False)
  ```
* **Output:**
  * mapdl: CDB file including the nodes and elements.
  * becas: BECAS IN input files: N2D, E2D, EMAT and MATPROPS. Optional FAILMAT.

#### *property* extrusion\_type

Section cut type. Options:

* `wire_frame`
* `surface_normal`
* `surface_sweep_based`

#### from\_global\_to\_local(global\_coords)

Transforms global coordinates into the local coordinate system of the section cut.

* **Parameters:**
  * **global\_coords**: The global coordinates to be transformed (x, y, z).

* **Example:** section\_cut.from\_global\_to\_local((2.3, 1.2, 4.3))

#### from\_local\_to\_global(local\_coords)

Transforms local coordinates into the global coordinate system.

* **Parameters:**
  * **local\_coords**: The local coordinates to be transformed (x, y, z).

If local\_coords is (x, y) only, then z is assumed to be 0.

#### *property* geometric\_measures

Cross-sectional measures of geometry.

#### *static* get\_sectional\_stiffness\_behavior(stiffness\_matrix, matrix\_format)

Returns the sectional stiffness values for a given matrix.

These are EA, GJ, GAx, GAy, EIx, and EIy. Use get\_transformed\_sectional\_properties\_matrix to
transform the stiffness matrix into the desired coordinate system and format.

* **Parameters:**

- **stiffness\_matrix**: The sectional stiffness matrix.
- **matrix\_format**: The format of the transformed matrix. Options:
  * `default`
  * `ansys`

* **Usage:**

```python theme={null}
>>> results = section_cut.compute_equivalent_beam_properties()
>>> my_matrix = section_cut.get_transformed_sectional_properties_matrix(properties=results.properties, position='origin', angle='global', matrix_type='stiffness_matrix', matrix_format='ansys')
>>> principal_stiffness_values = section_cut.get_sectional_stiffness_behavior(my_matrix, "ansys")
```

#### get\_sectype\_command\_from\_sectional\_properties(properties, stiffness\_matrix\_position, stiffness\_matrix\_angle, mass\_matrix\_position, mass\_matrix\_angle, sectype\_id)

Convert the equivalent stiffness and mass matrix into an Ansys sectype command.

The output (string) can be embedded into an Ansys input file to define a preintegrated
composite beam section. It can also be used in the Mechanical application via a command snippet.

* **Parameters:**

- **properties**: All sectional properties of the equivalent beam properties calculation.
- **stiffness\_matrix\_position**: The point to which the stiffness matrix is transformed. Options:
  * `origin`
  * `center of gravity`
  * `shear center`
  * `elastic center`
- **stiffness\_matrix\_angle**: The angle by which the stiffness matrix is rotated. Options:
  * `global`
  * `elastic axes angle`
  * `principal axes angle`
- **mass\_matrix\_position**: The point to which the mass matrix is transformed. Options:
  * `origin`
  * `center of gravity`
  * `shear center`
  * `elastic center`
- **mass\_matrix\_angle**: The angle by which the mass matrix is rotated. Options:
  * `global`
  * `elastic axes angle`
  * `principal axes angle`
- **sectype\_id**: Defines the index of the section.

* **Usage:**
  ```python theme={null}
  >>> result = section_cut.compute_equivalent_beam_properties(check_status=True)
  >>> command = section_cut.get_sectype_command_from_sectional_properties(
          properties=result.properties,
          stiffness_matrix_position="elastic center",
          stiffness_matrix_angle="elastic axes angle",
          mass_matrix_position="center of gravity",
          mass_matrix_angle="principal axes angle",
          sectype_id=1,
      )
  ```

#### get\_transformed\_sectional\_properties\_matrix(properties, position, angle, matrix\_type, matrix\_format)

Transform the global mass or stiffness matrix to the given point and rotate it by the given angle, for a specific format.

* **Parameters:**
  * **properties**: All sectional properties of the equivalent beam properties calculation.
  * **position**: The point to which the matrix is transformed. Options:
    * `origin`
    * `center of gravity`
    * `shear center`
    * `elastic center`
  * **angle**: The angle by which the matrix is rotated. Options:
    * `global`
    * `elastic axes angle`
    * `principal axes angle`
  * **matrix\_type**: The type of the matrix. Options:
    * `mass_matrix`
    * `stiffness_matrix`
  * **matrix\_format**: The format of the transformed matrix. Options:
    * `default`
    * `ansys` (Ansys Preintegrated Composite Beam)
* **Returns:**
  The transformed matrix (6,6).
* **Usage:**
  ```python theme={null}
  >>> result = section_cut.compute_equivalent_beam_properties(check_status=True)
  >>> transformed_stiffness_matrix = section_cut.get_transformed_sectional_properties_matrix(
          properties=result.properties,
          position="elastic center",
          angle="elastic axes angle",
          matrix_format="ansys",
          matrix_type="stiffness_matrix"
      )
  >>> transformed_mass_matrix = section_cut.get_transformed_sectional_properties_matrix(
          properties=result.properties,
          point="center of gravity",
          angle="principal axes angle",
          format="default",
          matrix_type="mass_matrix"
      )
  ```

#### *property* in\_plane\_reference\_direction1

Reference direction for cross-sectional measures.

#### *property* in\_plane\_reference\_direction2

Reference direction for cross-sectional measures.

#### *property* intersection\_type

Intersection type. Options: `normal_to_surface` and `in_plane`.

#### *property* locked

Section cut was imported and cannot be changed.

#### *property* mass\_measures

Cross-sectional measures of mass.

#### *property* node\_labels

Label of nodes within nx1 array.

#### *property* nodes

Returns nodes of this mesh as nx3 array.

#### *property* normal

Get/set the plane normal.

#### *property* number\_of\_interpolation\_points

User-defined number of interpolation points.

#### *property* origin

Get/set the plane origin.

#### *property* scale\_factor

Scale factor used for visualization of section cuts.

#### *property* scope\_element\_sets

Element sets to which the section cut is scoped. Only used if `scope_entire_model` is `False`.

#### *property* scope\_entire\_model

Whether the section cut is scoped to the entire model, or only selected element sets.

#### *property* search\_radius

User-defined search radius.

#### *property* section\_cut\_type

Section cut type. Options:

* `modeling_ply_wise`
* `production_ply_wise`
* `analysis_ply_wise`

#### *property* surface\_display\_data

Section cut surface plot.

#### *property* surface\_mesh

Section cut line surface mesh.

#### *property* tolerance

Tolerance used to generate the surface section cut.

#### *property* use\_default\_lut\_settings

Boolean whether to use the dault settings of the Lookup table.

#### *property* use\_default\_tolerance

Whether to use the default feature tolerance (0.1% of the averaged element size).

#### *property* vtk\_element\_data

Returns mesh coincidence data in the format needed by VTK.

#### *property* wireframe\_display\_data

Section cut wireframe plot.

#### *property* wireframe\_mesh

Section cut line wireframe mesh.

## `Sensor` class

#### *class* compolyx.Sensor(graph, obj, parent=None)

Sensor object for meassuring areas, prices, weights, and centers of gravity.

#### *property* active

Whether the sensor is computed on update.

#### add\_entity(entity)

Add entity to sensor.

#### *property* area

Area covered by all entities of the sensor.

#### *property* center\_of\_gravity

Center of gravity over all entities of the sensor.

#### clear\_entities()

Clear all entities of this sensor.

#### *property* enabled

Whether this object is currently enabled. Sensors are always enabled.

#### *property* entities

Entities of the sensor.

#### *property* locked

Sensor cut was imported and cannot be changed.

#### *property* modeling\_ply\_area

Cumulated area of all modeling plies involved.

#### *property* price

Price over all entities of the sensor.

#### *property* production\_ply\_area

Cumulated area of all production plies involved.

#### remove\_entity(entity)

Remove entity from sensor.

#### *property* sensor\_type

Sensor type. String options:

* `sensor_by_area`
* `sensor_by_plies`
* `sensor_by_material`
* `sensor_by_solid_model`

#### *property* weight

Weight over all entities of the sensor.

## `PlyBook` class

#### *class* compolyx.PlyBook(name='PlyBook', parent=None, reST\_ply='', reST\_chapter='', reST\_title\_page='', scene=None)

Class to represent a ply book.

#### *property* chapters

Dictionary with all chapters defined.

#### create\_chapter(name, view=None, ply\_entities=(), show\_rosettes=True)

Add a chapter to the ply book.

* **Parameters:**
  * **name**: Name of the chapter to be added.
  * **view**: The view for snapshots of the chapter.
  * **ply\_entities**: List of modeling plies and modeling groups for the chapter.
  * **show\_rosettes**: If `True`, then the show rosettes when creating ply snapshots.

#### generate(filename, format=None, \*\*write\_kwargs)

Generate the complete plybook.

* **Parameters:**
  * **filename**: Output filename.
  * **format**: Options:
    * `pdf`
    * `html`
    * `odt`
    * `txt`

#### *property* reST\_chapter

reST chapter template.

#### *property* reST\_ply

reST ply template.

#### *property* reST\_title\_page

reST title page template.

## `Chapter` class

### *class* compolyx.Chapter(name, parent, view=None, ply\_entities=(), id=0, show\_rosettes=True)

Class to represent plybook chapter.

#### generate\_reST(reST\_chapter\_template, reST\_ply\_template, image\_provider)

Get the interpolated reST string for the chapter.

#### get\_production\_plies()

Return a list of production plies which are associated with this chapter.

#### *property* ply\_entities

Plies/ply groups for the chapter.

#### *property* show\_rosettes

Show the rosettes linked to a ply in snapshots.

## `PublishedParameter` class

#### *class* compolyx.PublishedParameter(name, parent, source\_object=None, source\_property='', user\_script='', category='input', acp\_type=None, description='', lower\_limit=None, upper\_limit=None, cyclic=False, float\_list=\[], string\_list=\[], unbound\_value=None)

Class to represent parameters which are linked to the Ansys Workbench application.

#### *property* acp\_type

ACP parameter type. Options:

* `int`
* `float`
* `float_list`
* `bool`
* `string`
* `None`

#### *property* ansys\_type

The Ansys parameter type that ACP parameter is mapped to. Options:

* `int`
* `double`
* `boolean`
* `None`

#### *property* category

Categories: `input`, `unbound_input`, `output`, and `expression_output`.

#### *property* cyclic

Whether a float value is cyclic.

#### *property* description

A human-readable description of the linked parameter.

#### *property* enabled

Whether this object is currently enabled. Mainly defined through the current application mode pre or post.

#### *property* float\_list

A list of possible values for a float.

#### get\_source\_str()

Returns the active source string. Either the user script or the property (string) of the ACP object.

#### *property* lower\_limit

The lower limit for numeric values.

#### *property* name

Name of object.

#### serialize()

Serialize to Python string.

#### *property* string\_list

A list of possible values. List of objects if the property type is object, else list of strings.

#### *property* unit

The unit associated with the actual parameter value.

#### *property* upper\_limit

The upper limit for numeric values.

#### *property* value

The current parameter value. Under the Workbench application, setting the value should only be used for output parameters or to create (initialize) an input parameter. Otherwise the parameter values in ACP and the Workbench application are out of sync.

#### *property* wb\_value

The parameter value as it is represented in the Ansys Workbench application.

## `Script` class

#### *class* compolyx.Script(name, \*, parent=None, source=None, active=True, uptodate=False, update\_mode=ScriptUpdateMode.ON\_TRIGGERS)

Class to represent user-defined scripts operating on the input parameters.

#### *property* active

Whether the script should run.

#### *property* enabled

Whether this object is currently enabled. Mainly defined through the current application mode pre or post.

#### serialize()

Serialize to Python string.

#### *property* source

Source code of the user-defined script.

#### *property* status

String status indicating if the object is up-to-date.

#### *property* status\_changed

Specifies if the object has changed, for the purposes of notifying the Workbench application.

#### *property* update\_mode

Defines which changes cause the script to become out-of-date. Options:

* `manual` (run only when manually triggered)
* `on_triggers` (run when a parameter or the script itself changes)
* `always` (run with every update)

#### *property* uptodate

Whether the script execution is up-to-date.
