    

 ## On this page

  

 

 # Model classes

 Last update: 20.02.2025 

## [`Model`](#compolyx.Model)

### *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:

```pycon
>>> import compolyx
>>> db = compolyx.DB()
>>> model = db.import_model(name='class40.1', path='class40.cdb', format='ansys:cdb')

```

Get existing model:

```pycon
>>> 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. Choose one of ‘abaqus:fieldreport’, ‘ansys:prnsol’,’ansys:rst’, or ‘nastran:f06’.
    - subcase: Optional subcase to read. Only valid 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 valid 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 post-process 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.

Note: The reference directions computed by this function are not defined along the axis of symmetry, but along the circumferential direction using a cylindrical Rosette. This allows to handle edge cases such as elements normal to the symmetry plane with a single Rosette. As a result the “Ply Angle” of the generated plies is rotated by 90° with respect to the specified nominal angle in the layers list. The resulting fiber direction still matches the specified nominal angle: a nominal angle of 0° means that the fiber direction is along the Axial Direction.

The functions generates the following objects:

- A cylindrical Rosette which defines a reference direction along the circumferential direction of the axisymmetric body.
- An Oriented Selection Set.
- 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) &gt; max\_angle\_with\_thickness\_correction is not corrected. These layers always have the nominal layer thickness.
- **Usage:**```pycon
    >>> 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 or not.

#### 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 a edge set. Parameters:

- source: Source object to copy.

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

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

Copy a 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 Look-up Table

- **Parameters:**
    - source: Source object to copy.
- **Returns:**New instance of a Look-Up 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 new Boolean Selection Rule.

- **Parameters:**
    - name: Name of the Rule.
    - id: ID of the Rule.
    - include\_rule\_type: Whether the rule is of type include or exlude.
    - selection\_rules: List of tuples of attached rules and operation type.
- **Returns:**The created Boolean Selection Rule.

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

Create 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:**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: geometry, taper, or 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 taper, LookUpTableColumn for 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 laminate\_stack or 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 Cylindircal Rule.
    - direction: Direction of the Cylindircal Rule.
    - radius: Radius of the Cylindircal Rule.
    - relative\_rule\_type: If True 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 Cylindircal 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 new Edge Set.

- **Parameters:**
    - name: Name of the Edge Set.
    - edge\_set\_type: ‘By Nodes’, ‘By Reference’, or ‘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 new element set.

- **Parameters:**
    - name: Name of the Element Set.
    - element\_labels: Indices of elements to be assigned to 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. Valid options: all, new (default), add, remove, intersect, inverse, or 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 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 oriented element set.
    - id: The ID of the oriented element set.
    - 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: Bool. 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. The value can be `geometry` (default) or `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 wheter to use the projection normal or not.
    - 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 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 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 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 whether to delete the erroneous elements or not.
    - 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 Look-Up Table object.

- **Parameters:**
    - name: Name.
    - id: ID.
- **Returns:**The created Look-Up 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 Look-Up Table object.

- **Parameters:**
    - name: Name.
    - id: ID.
    - tabular\_data: Data points and values of the look-up 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 Look-Up 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)

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 (‘minimum\_angle’, ‘maximum\_angle’, ‘minimum\_distance’, ‘minimum\_angle\_superposed’, ‘minimum\_distance\_superposed’, ‘maximum\_angle\_superposed’, ‘ansys\_classic’, or ‘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, either ‘woven’ or ‘unidirectional’
    - draping\_ud\_coefficient: Coefficient for the unidirectional draping material model.
- **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 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 Disance of the Parallel Selection Rule.
    - neg\_distance: Negative Distance of the Parallel Selection Rule.
    - relative\_rule\_type: If True 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. Can be one of input, unbound\_input, output, or 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 or not.
    - 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 PublishedParameter.

#### 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 ( ‘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 / the 3D window or not.
- **Returns:**The created Rosette.
- **Example:**```pycon
    >>> 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 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) or not.
    - solution\_set: Specifies the solution and the set of the element-wise post-processing. Note, this must be given as a tuple.
- **Returns:**The created Sampling Point.

#### create\_scene(name, id=None, title='', active\_set=None, projection='perspective', 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 allows 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. Can be either `manual` (run only when manually triggered), `on_triggers` (run when a parameter or the script itself changes), or `always` (run with every update).
- **Returns:**The created Script object.

#### create\_section\_cut(name, id=None, 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.
    - origin: Origin of the section cut plane.
    - normal: Normal of the section cut plane.
    - in\_plane\_reference\_direction1: Local x-direction of the sectin 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 or not. 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.
- **Return:**The new section cut object.

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

Create new Sensor.

- **Parameters:**
    - name: Name of the Rule.
    - sensor\_type: Type of Sensor values are: 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, 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 fo 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: Inside ply (one element inside the ply boundary), outside ply (one element outside the ply boundary).
    - offset\_type: 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.
    - use\_default\_element\_index: Consecutive element numbering if set to true.
    - element\_index: Start index for first element (only relevant if 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 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 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).
    - 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 whether to delete the erroneous elements or not.
    - disable\_dropoffs\_on\_top: Boolean whether to disalbe the drop-off elements on the top surface of the laminate.
    - disable\_dropoffs\_on\_bottom: Boolean 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 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)

Create new Tube Selection Rule.

- **Parameters:**
    - name: Name of the rule.
    - radius: Radius of the rule.
    - include\_rule\_type: Include or Exclude area in rule.
    - edge\_set: Edge Set for the rule.
- **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 evaluat the radius/offset along the surface or not.
    - 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 lay-up 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 defintions.

- **Parameters:**
    - path: .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)

Export layup to Composite CAE HDF5 file.

- **parameters:**
    - path: Save path of the h5 file.
    - remove\_midside\_nodes: Whether midside nodes should be exported or not.
    - layup\_representation\_3d: Whether to compute the 3D lay-up representation of the model. See note.
    - offset\_type: Specifies the ply surface to export. Valid options: bottom\_offset, middle\_offset, or 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, all elements will be considered.
    - modeling\_plies: A list of Modeling Plies and/or Modeling Groups. If empty list or None, all modeling plies will be exported.

Note about layup\_representation\_3d: the 3D lay-up 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 it can 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 ANSYS Workbench.

> - **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 (allowed extensions are .iges, .igs, .step, .stp and .stl).
    - plies: List of plies (allowed are modeling, production and 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. Valid options are `no_offset`, `middle_offset` (default), `top_offset`, and `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. Valid options: `standard_arrow`, `no_arrow` (default), and `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'\])

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

- **Parameters:**
    - directory: Directory to save the models.
    - prefix: Prefix of the model. Default ACPSolidModel\_
    - delete\_existing: Flag if existing models should be deleted. Default True.
    - formats: Available file formats are ‘cdb’ or h5. Default \[‘cdb’, ‘h5’\].

#### *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 an empty list is returned.
- **Examples:**

```pycon
>>> 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. Choose one of ‘ansys:h5’, ‘ansys:cdb’, ‘ansys:dat’, or ‘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: Valid 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 and then 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: Valid 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 and then generated from scratch.
    - modeling\_group: Key of the mpg\_collection dict = 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: Valid 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 and then 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.
        
        
        - 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 or solid data.
        
        
        - shell: Default. The imported components are mapped onto the reference surface and converted into Modeling Plies.
        - solid: The components are imported one-to-one exposed as Imported Plies. Can be used in combination with ImportedSolidModel (lay-up 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 or not.
    - element\_sets: A list of Element Sets.
    - offset: Offset for imported plies. Defines if imported mesh is interpreted as bottom, middle or top ply surface. Valid modes are ‘bottom\_offset’, ‘middle\_offset’, ‘top\_offset’.
    - coord\_transform\_inputs: Coordinate transform 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 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 WB, this function loads all objects but the mesh, materials and plots In stand-alone mode, all objects but the 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 lay-up of a legacy (MAPDL) 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 are ‘ansys:cdb’ and ‘ansys:dat’.
    - materials\_mask\_prefix: Defines the prefix that is added to the Matierla ID while importing materials via ExternalModel.
    - materials\_mask\_suffix: Defines the suffix that is added to the Matierla ID while importing materials via ExternalModel.
- **Materials mapping:**Only relevant when the import happens within Workbench. The materials mask prefix and suffix parameters eable automatic mapping of Workbench 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:**```pycon
    >>> 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 Look-Up 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: design\_angle (default), shear, draped\_fiber\_angle, ordraped\_transverse\_angle.
        - thickness: thickness (default) or relative\_thickness\_correction.
    - position: Position where data is queried: 
        - nodal.
        - centroid.
        - element\_nodal.
    - selection: The selection set determines the selected nodes and elements. Can be given as string ‘sel0’ - ‘sel5’ or ‘all’, or can be given as ObjectSelection object such as 
        - model.selection.
        - scene.active\_set.
    - entity: Specialized queries require the specification of an additional associated entity. For example, an oriented element set is needed to compute orientations. An entity can be given as NamedGraphObjects or vertex descriptor.
    - entities: If a list of entities is given, 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.

#### *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 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:**```pycon
    >>> 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 (set by user).

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

Refresh material external data sources in the model acph5 db. 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). Ignored imported entities are the 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:**```pycon
    >>> 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 or not.

#### 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: Optional parameter if left the entire layup is written to the file, else only the layup defined within modeling\_groups.

#### 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: Optional parameter if left the entire layup is written to the file, else only the layup defined within modeling\_groups.

#### 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: Optional parameter if left the entire layup is written to the file, else only the layup defined within modeling\_groups.

#### *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 given selection as SELECTED.

- **Parameters:**
    - selection: The selection to update. Can be given as string ‘sel0’ - ‘sel5’ or ‘all’ or can be given as ObjectSelection object such as 
        - model.selection.
        - scene.active\_set.
    - op: Select operation. Valid options: all, new (default), add, remove, intersect, inverse, or 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: 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 ‘sel0’ - ‘sel5’ or ‘all’, or can be given as ObjectSelection object such as 
        - model.selection.
        - scene.active\_set.
    - op: Select operation. Can be 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” 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 or not.

#### *property* solid\_models

SolidModel.

#### *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. Unit system types are: 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.

## [`Rosette`](#compolyx.Rosette)

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

Rosette class.

Access:

```pycon
>>> 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, r for CYLINDRICAL, RADIAL, and SPHERICAL.
    - y = y for PARALLEL, phi for CYLINDRICAL, RADIAL, and SPHERICAL.
    - z = z for PARALLEL, CYLINDRICAL, RADIAL, and theta for SPHERICAL.
- **Usage:**```pycon
    >>> rosette.get_global_coordinates((1.,2.,3.))
    
    ```

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

gets global vector components from local rosette vector components. 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, RADIAL, and theta for SPHERICAL.
- **Usage:**```pycon
    >>> 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, r for CYLINDRICAL, RADIAL, and SPHERICAL.
- y = y for PARALLEL, phi for CYLINDRICAL, RADIAL, and SPHERICAL.
- z = z for PARALLEL, CYLINDRICAL, RADIAL, and theta for SPHERICAL.
    
    CYLINDRICAL, RADIAL, and SPHERICAL coordinate system type: phi and theta in RAD.

- **Usage:**```pycon
    >>> 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, r for CYLINDRICAL, RADIAL, and SPHERICAL.
- y = y for PARALLEL, phi for CYLINDRICAL, RADIAL, and SPHERICAL.
- z = z for PARALLEL, CYLINDRICAL, RADIAL ,and theta for SPHERICAL.
    
    CYLINDRICAL, RADIAL and SPHERICAL coordinate system type: phi and theta in RAD.

- **Usage:**```pycon
    >>> 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 Types. Valid options: parallel, radial, cylindrical, spherical, or 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

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

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

Bases: `NamedGraphFuncObject`

Look-Up Table Class.

Associates scalar or vector values to points.

Example:

```pycon
>>> 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`, `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`](#compolyx.LookUpTable1D)

### *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 Look Up Table.

#### *property* origin

The Origin of the Look Up 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`](#compolyx.LookUpTable3D)

### *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. Valid options: 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:**

```pycon
  >>> 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`](#compolyx.LookUpTableColumn)

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

An object to hold a column in a table.

#### *property* enabled

Whether this object is currently enabled or not. 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`](#compolyx.ElementSelectionRule) classes

### *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`](#compolyx.ParallelSelectionRule)

### *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`](#compolyx.CylindricalSelectionRule)

### *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`](#compolyx.SphericalSelectionRule)

### *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`](#compolyx.TubeSelectionRule)

### *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 which define the guid 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 or not.

#### *property* tail\_extension

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

### [`CutoffSelectionRule`](#compolyx.CutoffSelectionRule)

### *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. Valid values: geometry, taper, and 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 Types. Valid options: production\_ply\_cutoff or analysis\_ply\_cutoff.

#### *property* ply\_tapering

Use Ply Tapering Orientation.

### [`GeometricalSelectionRule`](#compolyx.GeometricalSelectionRule)

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

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

Geometrical Selection Rule.

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

Add Element Set to GeometricalSelection 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. Valid values: geometry and 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 or not.

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

Whether to use a projection normal for outlines or not.

### [`BooleanSelectionRule`](#compolyx.BooleanSelectionRule)

### *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 or not.
    - rule\_values: Parameters of the template rule (For instance upper and lower limit of a ParallelSelectionRule).
    - operation\_type: Boolean operation type (intersect, add, remove).
- **Example:**

> > > 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`](#compolyx.VariableOffsetSelectionRule)

### *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 Look-Up 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`](#compolyx.EntitySet) classes

### *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`](#compolyx.ElementSet)

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

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

Element set class.

- **Exemplary usage:**```pycon
    >>> 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: new, add, remove, intersect. or 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 ElementSet into new ElementSets with an orientable topology. if this ElementSet is already orientable, 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`](#compolyx.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. Valid options: “By Reference” or “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 NodeSet (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`](#compolyx.CADGeometry)

### *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, etc.).

#### 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. This option should be used with care!

#### *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 or not.

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

Whether to use default precision value or not.

#### *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`](#compolyx.CADCompound)

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

ComPoLyX Class to represent CADCompound.

#### *property* sub\_shapes

Sub faces of the CAD Compound.

### [`CADSolid`](#compolyx.CADSolid)

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

ComPoLyX Class to represent CADSolid.

#### *property* sub\_shapes

Sub faces of the CAD Solid.

### [`CADShell`](#compolyx.CADShell)

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

ComPoLyX Class to represent CADShell.

#### *property* sub\_shapes

Sub faces of the CAD Shell.

### [`CADFace`](#compolyx.CADFace)

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

ComPoLyX Class to represent CADFace.

### [`VirtualGeometry`](#compolyx.VirtualGeometry)

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

ComPoLyX Class to represent VirtualGeometry.

#### add(shape)

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

- **Parameters:**
    - shape: A tuple. The first item is the shape object and the second the link path (root path) of the shape.

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

- **Usage:**```pycon
    >>> 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 CADGeometry. Read only.

#### *property* cad\_references

Dictionary of all cad references.

#### clear\_cad\_references()

Clear all linked references (VirtualGeometry 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: Geometry path of the linked CAD component.
    - 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. CADCompound, CADSolid, CADShell or 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, 1 = curve.

#### remove(shape)

Removes the CADReference object for the given shape.

- **Usage:**```pycon
    >>> 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:**```pycon
    >>> 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 VirtualGeometry.

### [`CADReference`](#compolyx.CADReference)

### *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

Link path of the CADReference

#### *property* size

Size of the linked CAD shape.

#### *property* status

Status of the CADReference.

## [`OrientedSelectionSet`](#compolyx.OrientedSelectionSet)

### *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 or not.

#### *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 Element 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 look-up 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.

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

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

- **Parameters:**
    - filename: Path to the file to be writen.

#### *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`](#compolyx.ModelingGroup)

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

Class to manage modeling groups.

Access:

```pycon
>>> import compolyx
>>> db = compolyx.DB()
>>> model = db.models['class40.1']
>>> mpg = model.modeling_groups['PlyGroup.1']

```

Creation:

```pycon
>>> 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 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 a Interface Layer

- **Parameters:**
    - source: Source object to copy.
    - global\_ply\_nr: Global ply number to use. If 0 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 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 an 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 whether the butt joint sequence is active or not.
- **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 Interface Layer.

- **Parameters:**
    - name: Name of the new Interface Layer.
    - id: Optional ID of the new Interface Layer.
    - global\_ply\_nr: Ply number for stacking sequence.
    - oriented\_selection\_sets: Oriented Selection Set for the expansion of the Interface Layer.
    - open\_area\_sets: Defines the initial crack of a VCCT layer (optional).
    - active: Interface Layer active. Default True.
- **Returns:**The created Interface Layer.
- **Example:**```pycon
    >>> 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 “no\_draping”, “evaluate\_draping”, or “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: Wheterh 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: Look-Up table column with scalar values for thickness sampling (optional).
    - thickness\_field\_type: The type of thickness field ‘absolute’ or ‘relative’.
    - angle\_1\_field: Look-Up table column with scalar values for angle 1.
    - angle\_2\_field: Look-Up table column with scalar values for angle 2.
- **Returns:**The created Modeling Ply.
- **Example:**```pycon
    >>> 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 (allowed extensions are .iges, .igs, .step, and .stp).
    - ply\_level: Defines which plies are exported: modeling\_ply\_wise, production\_ply\_wise or analysis\_ply\_wise. Default is production\_ply\_wise.
    - 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. Valid options: no\_offset, middle\_offset (default), top\_offset, or 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. Valid 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, the modeling plies retain their original global ply number.

- **Parameters:**
    - source: list of plies to insert at new position.
    - target: position to insert plies. Can be modeling group or sequence entity.
    - option: where to insert: after (default), before, or end (for SequenceEntity targets), 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`](#compolyx.ModelingPly)

### *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 ModelingPly.

#### 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: Bool.
    - rule\_values: Parameters of the template rule.
    - operation\_type: Boolean operation type (intersect, add, 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: ‘standard\_arrow’ (default), ‘no\_arrow’, ‘half\_arrow’.
    - offset\_type: ‘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 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 ModelingPly.

#### 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

LookUpTable 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: ‘iges’, ‘step’, or None (automatic format recognition).
    - offset\_type: ‘no\_offset’ (default), ‘bottom\_offset’, ‘middle\_offset’, or ‘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 (‘standard\_arrow’(default), ‘no\_arrow’, ‘half\_arrow’).

### `ProductionPly`

### *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: ‘standard\_arrow’ (default), ‘no\_arrow’, ‘half\_arrow’.
    - offset\_type: ‘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 File.

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

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

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

- **Parameters:**
    - filename: Path to the file to be writen.

#### *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: ‘iges’, ‘step’, or None (automatic format recognition).
    - offset\_type: ‘no\_offset’ (default), ‘bottom\_offset’, ‘middle\_offset’, or ‘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 (‘standard\_arrow’(default), ‘no\_arrow’, or ‘half\_arrow’).

### [`AnalysisPly`](#compolyx.AnalysisPly)

### *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: ‘standard\_arrow’ (default), ‘no\_arrow’, ‘half\_arrow’.
    - offset\_type: ‘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 AnalysisPly is a reinforcing ply.

For instance, if linked to a Lay-up 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 plyis 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: ‘iges’, ‘step’, or None (automatic format recognition).
    - offset\_type: ‘no\_offset’ (default), ‘bottom\_offset’, ‘middle\_offset’, or ‘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 (‘standard\_arrow’(default), ‘no\_arrow’, or ‘half\_arrow’).

### [`InterfaceLayer`](#compolyx.InterfaceLayer)

### *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 or not.

#### *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`](#compolyx.ButtJointSequence)

### *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`](#compolyx.ImportedModelingGroup)

### *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)

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 or not.
    - 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 (‘minimum\_angle’, ‘maximum\_angle’, ‘minimum\_distance’, ‘minimum\_angle\_superposed’, ‘minimum\_distance\_superposed’, ‘maximum\_angle\_superposed’, ‘ansys\_classic’, or ‘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 is tabular\_values.
    - thickness\_definition: Enum that describes the method used for thickness definition (Default: nominal).
    - thickness\_field: Look-Up 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: Look-Up table column with scalar values for angle 1.
    - angle\_2\_field: Look-Up table column with scalar values for angle 2.
- **Returns:**The created Imported Modeling Ply.
- **Example:**```pycon
    >>> 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`](#compolyx.ImportedModelingPly)

### *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 look-up 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* 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`](#compolyx.ImportedProductionPly)

### *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`](#compolyx.ImportedAnalysisPly)

### *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 AnalysisPly is a reinforcing ply.

For instance, if linked to a Lay-up 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`](#compolyx.FieldDefinition)

### *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 or not. 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

Look-up table used with this field definition.

#### *property* scope\_entities

The entities defining the scope of the field definition. Allowed are Element Sets, Modeling Plies and Oriented Selection Sets.

#### serialize()

Serialize to Python string.

## [`SamplingPoint`](#compolyx.SamplingPoint)

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

The Sampling Point allows to pick 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.

- **Usage:**```pycon
    >>> 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 or not (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). 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:**

```pycon
 >>> 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 or not (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: List containing Strain definition name and component.
    - \[‘e1’, ‘e2’, ‘e3’, ‘e12’, ‘e13’, ‘e23’, ‘eI’, ‘eII’, ‘eIII’\].
    - stresses: List containing Stress definition name and component.
    - \[‘s1’, ‘s2’, ‘s3’, ‘s12’, ‘s13’, ‘s23’, ‘sI’, ‘sII’, ‘sIII’\].
    - failures:\[‘FailureCriteria.1\_irf’, ‘FailureCriteria.1\_rf’, ‘FailureCriteria.1\_mos’, ‘FailureCriteria.1\_fm’\] - Name of FC and value.
    - text\_labels: \[‘material’, ‘angle’, ‘thickness’\].
- **Usage:**```pycon
    >>> 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 or not. SamplingPoints 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 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 or not (B-Matrix). It’s only of relevance for the laminate engineering constants.

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

Flag to use default reference direction.

## [`SectionCut`](#compolyx.SectionCut)

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

Section Cut Class showing the lay-up in the cutting plane.

#### *property* active

Whether a section cut is computed on update or not.

#### *property* changed

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

#### *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 or not. SectionCuts are always enabled.

#### export\_surface\_section\_cut(path, format='becas:in', export\_strength\_limits=True)

Exports the suface section cut to BECAS or ANSYS MAPDL.

- **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: Boolean whether to export the strength limits for BECAS. True by default.
- **Usage:**```pycon
    >>> section_cut.export_surface_section_cut(r'D:\tmp\section_cut.cdb', 'ansys:cdb', 1.e-3)
    >>> 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 Types. Valid options: wire\_frame, urface\_normal, and surface\_sweep\_based.

#### *property* geometric\_measures

Cross-sectional Measures of Geometry.

#### *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 Types. Valid options: normal\_to\_surface or 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 Types. Valid options: modeling\_ply\_wise, production\_ply\_wise, and 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`](#compolyx.Sensor)

### *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 or not.

#### 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 or not. 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. Valid string values: sensor\_by\_area, sensor\_by\_plies, sensor\_by\_materialm and sensor\_by\_solid\_model.

#### *property* weight

Weight over all Entities of the Sensor.

## PlyBook

### [`PlyBook`](#compolyx.PlyBook)

### *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, show rosettes when creating ply snapshots.

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

Generate the complete plybook.

- **Parameters:**
    - filename: Output filename.
    - format: .pdf, .html, .odt, or .txt.

#### *property* reST\_chapter

reST chapter template.

#### *property* reST\_ply

reST ply template.

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

reST title page template.

### [`Chapter`](#compolyx.Chapter)

### *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/PlyGroups for the chapter..

#### *property* show\_rosettes

Show the rosettes linked to a ply in snapshots.

## [`PublishedParameter`](#compolyx.PublishedParameter)

### *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.

#### *property* acp\_type

ACP parameter type. Valid options: ‘int’, ‘float’, ‘float\_list’, ‘bool’, ‘string’, or None.

#### *property* ansys\_type

ANSYS parameter type where ACP parameter is mapped to. Valid options: ‘int’, ‘double’, ‘boolean’, or None.

#### *property* category

Valid options: input, unbound\_input, output, or expression\_output.

#### *property* cyclic

Whether a float value is cyclic or not.

#### *property* description

A human-readable description of the linked parameter.

#### *property* enabled

Whether this object is currently enabled or not. 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 actual parameter value.

#### *property* wb\_value

The parameter value as it is represented in the ANSYS Workbench.

## [`Script`](#compolyx.Script)

### *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 or not.

#### *property* enabled

Whether this object is currently enabled or not. 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 Workbench.

#### *property* update\_mode

Defines which changes cause the script to become out-of-date. Can be either `manual` (run only when manually triggered), `on_triggers` (run when a parameter or the script itself changes), or `always` (run with every update).

#### *property* uptodate

Whether the script execution is up to date.