Handling Property Types

This section provides examples of how to handle the various property types used within ANSYS Mechanical.

Quantity: A unit-based value typically related to a physical quantity.

Example:

my_object.ElementSize = Quantity("0.1 [m]")

Numerical Value (float and integer): A property, such as Relevance or Rate, expecting a numerical value (a number for which a unit is not specified).

Example:

my_object.TetraGrowthRate = 2

Boolean: A property expecting a True or False value.

Example:

my_object.WriteICEMCFDFiles = True

Geometry Scoping: A property whose value is one or more geometric entities. In these cases, you must:

  1. Create selection information and specify the IDs of the entities that you want to manipulate.

  2. Assign this list of IDs to Location / SourceGeometry properties.

Example:

my_selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
my_selection.Ids= [28,25]

My_object.Location = my_selection

Release 18.2 - © ANSYS, Inc. All rights reserved.