Mechanical Setup

Mechanical Setup
This container holds Set Up 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 setup component with default optional parameter values.

    setup.Edit()

Or by specifying optional parameter values:

    setup.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

Writes either an APDL input file (for use with the ANSYS solver) or a CAE Representation file (for use with any solver).

Required Arguments

Path    If the SetupDataType is 'InputFile', this should be a file path. If the SetupDataType is 'CAERepresentation', this should be a folder path.
    Type     string
SetupDataType    Type of setup data to write to disk. Available options are: 'InputFile' and 'CAERepresentation'.
    Type     string

GetMechanicalSetupFile

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

Return     A reference to the requested MechanicalSetupFile 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

GetPhysicsType

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

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

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\")")


SetDesignAssessmentFile

Set the design assessment

Required Arguments

FilePath    The design assessment file's path.
    Type     string

Data Entities

DesignAssessmentSetupSettingsType

The data entity that holds the setup properties for a Design Assessment.

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
SolverTarget

The type of assessment to be performed.

Type     string
Read Only    No
UserAttributeFile

The file to specify attributes to perform a User Defined design assessment.

Type     string
Read Only    No