Mechanical Model

Mechanical Model
This container holds Model data for an instance of Ansys Mechanical.

Methods

Edit

Opens the Mechanical editor and attaches geometry.

Optional Arguments

Hidden    Specify if Mechanical will open in hidden mode. The default value is false.
    Type     bool
    Default Value    False
Interactive    Specify if Mechanical will open in interactive mode. The default value is true.
    Type     bool
    Default Value    True
StartAsReadOnly    Specify if Mechanical will open in read-only mode. The default value is false.
    Type     bool
    Default Value    False
Example

To edit the model component with default optional parameter values:

    model.Edit()

Or by specifying optional parameter values:

    model.Edit(Interactive=True)


Exit

Exit the Mechanical editor

Optional Arguments

SaveDatabase    Indicates whether the Mechanical database will be saved prior to exiting
    Type     bool
    Default Value    True

Export

Exports a .dsdb file for the model component.

Required Arguments

FilePath    The path and name of the .dsdb file to be written.
    Type     string

ExportASMJournal

Exports an ASM Journal (.wbjn) and supporting files for the model component.

Required Arguments

FilePath    The path and name of the .wbjn file to be written. Supporting files written alongside.
    Type     string

ExportGeometry

Exports a PartManager database (.pmdb) file for the geometry in the model component.

Required Arguments

FilePath    The path and name of the .pmdb file to be written.
    Type     string

ExportMesh

Exports a .acmo file for the mesh in the model component.

Required Arguments

FilePath    The path and name of the .acmo file to be written.
    Type     string

GetACPImportOptions

Query to return the data reference to the acp import options

Return     The Data Entity containing settings for this component.
    Type     DataReference

Required Arguments

Name    The entity of interest.
    Type     string

GetMechanicalMesh

Query to return the reference to the container's MechanicalMesh data entity.

Return     A reference to the requested MechanicalMesh data entity.
    Type     DataReference

GetMechanicalMeshFile

Query to return the reference to the container's MechanicalMeshFile data entity.

Return     A reference to the requested MechanicalMeshFile data entity.
    Type     DataReference

GetMechanicalModel

Query to return the reference to the container's MechanicalModel data entity.

Return     A reference to the requested MechanicalModel data entity.
    Type     DataReference

GetMechanicalSystemType

Query to return the reference to the container's MechanicalSystemType data entity.

Return     A reference to the requested MechanicalSystemType data entity.
    Type     DataReference

GetMeshProperties

Query to return the reference to the container's MeshProperties data entity

Return     The Data Entity containing settings for this component.
    Type     DataReference

GetModelComponentProperties

Query to return the reference to the container's ModelComponentProperties data entity

Return     The Data Entity containing settings for this component.
    Type     DataReference

GetSimulationImportOptions

Query to return the data reference to the simulation import options

Return     The Data Entity containing settings for this component.
    Type     DataReference

Required Arguments

Name    The entity of interest.
    Type     string

ImportMesh

Imports a mesh file into Mechanical

Required Arguments

FilePath    The path and name of the mesh file to be imported.
    Type     string
IsMeshingEnabled    Enable or disable meshing on the imported mesh
    Type     bool

SendCommand

Executes a JScript or python command in the Mechanical editor.

If the Mechanical editor is not open, then the editor's GUI will not be available, causing some commands to fail. In this case, consider calling the container's Edit method to open the editor before using SendCommand.

Furthermore, if the Mechanical editor is not open, SendCommand will start the editor without the GUI, issue the specified command, and then close the editor. For multiple SendCommands, this may degrade performance.

Required Arguments

Command    Command argument containing the command.
    Type    string

Optional Arguments

ExtensionName    Extension name for the command Only available with Python commmands and defaults to empty
    Type    string
Language    Language of the command. The default value of Language is "Javascript".
    Type    string
    Default Value    Javascript
Example

To execute some arbitrary command (in this case, causing a dialog box to appear) in the Mechanical editor:

    model.SendCommand(Command="WBScript.Out(\"My Text\",true);" )

To run a JScript file already saved to disk using Run Macro from Mechanical:

    setup.SendCommand(Command="WB.AppletList.Applet(\"DSApplet\").App.Script.doToolsRunMacro(\"C:\\\\macro.js\")")


Data Entities

ACPImportOptions

Import options for model assembly available on the downstream model

Properties

DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
MaterialDesignerLoadCase

No details are provided for this entry.

Type     LoadCaseType
Read Only    No
MirrorTransform

Mirror Transformations for the Source Geometry

Type     MirrorTransformOptionsForSimulation
Read Only    No
NumberOfCopies

By default this value is 0, specifies how many additional copies of the upstream model are needed

Type     int
Read Only    No
RenumberMeshElementsAutomatically

By default this value is true, specifies whether the user would like us to automatically renumber his mesh elements to prevent unique id conflicts during assembly

Type     bool
Read Only    No
RigidTransform

Rigid Transformations for the Source Geometry

Type     RigidTransformOptionsForSimulation
Read Only    No
SmoothingCdb

Which upstream CDB file generated by mechanical to use as our model source

Type     string
Read Only    No
Source

The upstream model source

Type     DataReference
Read Only    No
TransferType

Tag specified by the user to name objects in mechanical

Type     TransferType
Read Only    No
TransformationType

Which type of transform we should display to the user

Type     TransformType
Read Only    No

GeneralModelAssemblyProperties

Class used to expose general properties for the model assembly workflow

Properties

DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
GroupObjectsBySource

Group objects in Mechanical based on source

Type     bool
Read Only    No
LengthUnit

Length unit of assembled model

Type     string
Read Only    No
ObjectRenaming

Name objects in Mechanical based on selected option

Type     ObjectRenamingTypeInMechanical
Read Only    No

MechanicalMesh

This is the mesh data entity object that will exist in the model container.

Properties

Caption

Caption used to identify the mesh.

Type     string
Read Only    No
DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
MeshId

Mesh identifier that corresponds with Mesh ID in Mechanical

Type     int
Read Only    No

MechanicalModel

The model data entity in the model container.

Properties

AcpRenumberingInformation

ACP automatic renumbering of transfer information

Type     Dictionary<string, List<DataReference>>
Read Only    No
AllowMeshing

Property used to prevent a re meshing in model assembly workflows

Type     bool
Read Only    No
Caption

Caption to identify the model

Type     string
Read Only    No
DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
EdaFile

Reference to a material database

Type     DataReference
Read Only    No
File

Reference to the Mechanical database

Type     DataReference
Read Only    No
IsResetNotRequired

Property used to prevent cascasding resets on downstream containers

Type     bool
Read Only    No
MeshFile

Reference to the Mechanical mesh database

Type     DataReference
Read Only    No
ModelConversionAssociativityMap

ACP automatic renumbering of transfer information

Type     Dictionary<string, string>
Read Only    No
ModelId

Model identifier that corresponds with the ID on Model tree node in Mechanical

Type     int
Read Only    No
PrimeMeshFile

Reference to the Engineering Model database

Type     DataReference
Read Only    No
PrototypeId

Prototype identifier which corresponds to the ID on the Geometry tree node in Mechanical

Type     int
Read Only    No

MechanicalSystemType

This entity provides string based information about the physics, analysis, and solver settings for the Mechanical system component.

Properties

AnalysisTypeDisplayString

The string which represents current analysis type setting.

Type     string
Read Only    Yes
DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
PhysicsTypeDisplayString

The string which represents current physics type setting.

Type     string
Read Only    Yes
SolverTypeDisplayString

The string which represents current solver type setting.

Type     string
Read Only    Yes

MeshConversionOptionsEntity

(Beta) Entity to control the Skin Detection algorithm for importing cdb files.

Properties

BodyGroupingType

Body grouping type

Type     BodyGroupingType
Read Only    No
ComponentKey

If the nodal components will be processed during CDB components the nodal component key will allow filtering of which components to process

Type     string
Read Only    No
CreateGeometry

Flag to create geometry

Type     bool
Read Only    No
CreateGeometryEdgeComponents

Should the geometry edge named selections be created during CDB conversion

Type     bool
Read Only    No
CreateGeometryFaceComponents

Should the geometry face named selections be created during CDB conversion

Type     bool
Read Only    No
CreateGeometryVertexComponents

Should the geometry vertex named selections be created during CDB conversion

Type     bool
Read Only    No
CutAngle

Only displayed if Forbid Close Components equals Yes. It is the angle used to cut closed surfaces to separate the elements into components.

Type     Quantity
Read Only    No
DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
ForbidCloseComponents

Option to split closed surfaces into several components.If Yes then the algorithm cuts closed surfaces into several components. It provides a simple method to avoid problematic faces on closed surfaces.

Type     bool
Read Only    No
GeometryImportAnalysisType

The geometry attach type for the CDB file

Type     GeometryAttachType
Read Only    No
ProcessLineBodies

Should line bodies be processed during the CDB conversion

Type     bool
Read Only    No
ToleranceAngle

The tolerance angle to seperate two elements into seperate components. If the angle between the normals of two adjacent elements is less than or equal to the Tolerance Angle then the two elements are in the same component, otherwise, they are separated.

Type     Quantity
Read Only    No
VertexInsertionAngle

The Vertex Insertion Angle is the minimunm angle to insert a vertex between two free edges of mesh. During the generation of the geometry, if two segments of an edge abruptly make an angle greater than the Vertex Insertion Angle, then the edge is split and a vertex is inserted.

Type     Quantity
Read Only    No

ModelComponentProperties

No details are provided for this entry.

Properties

DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
License

No details are provided for this entry.

Type     string
Read Only    No

ModelOutputSettingsForACP

Entity to control the properties of mesh file generated by Mechanical Model.

Properties

DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
LengthUnit

Length unit to write mesh file.

Type     string
Read Only    No

SimulationImportOptions

Import options for model assembly available on the downstream model

Properties

DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
MaterialDesignerLoadCase

No details are provided for this entry.

Type     LoadCaseType
Read Only    No
MirrorTransform

Mirror Transformations for the Source Geometry

Type     MirrorTransformOptionsForSimulation
Read Only    No
NumberOfCopies

By default this value is 0, specifies how many additional copies of the upstream model are needed

Type     int
Read Only    No
RenumberMeshElementsAutomatically

By default this value is true, specifies whether the user would like us to automatically renumber his mesh elements to prevent unique id conflicts during assembly

Type     bool
Read Only    No
RigidTransform

Rigid Transformations for the Source Geometry

Type     RigidTransformOptionsForSimulation
Read Only    No
SmoothingCdb

Which upstream CDB file generated by mechanical to use as our model source

Type     string
Read Only    No
Source

The upstream model source

Type     DataReference
Read Only    No
TransformationType

Which type of transform we should display to the user

Type     TransformType
Read Only    No

SimulationMeshProperties

Entity to control mesh properties for a Mechanical Model

Properties

DisplayText

The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.

Type     string
Read Only    No
saveMeshFileInSeparateFile

Group objects in Meshing based on source

Type     bool
Read Only    No