Expand/Collapse all
Scripting Quick Start
Scripting Introduction
Mechanical Scripting View
Working with the Editor
Working with the Shell
Autocompletion
Snippets
Supplied Snippets
Snippet Usage Example
Snippet Inserter
Snippet Creation and Management
Keyboard Shortcuts
Editor and Shell Keyboard Shortcuts
Text Editor Keyboard Shortcuts
Line Operation Shortcuts
Selection Shortcuts
Multi-Cursor Shortcuts
Go-To Shortcuts
Folding Shortcuts
Other Shortcuts
Recording APIs
Debugging Scripts and Extensions
Scope Selection for ACT Extensions
Opening Mechanical with Scripts
Key Usage Concepts
Threading
Using Scripts to Create User-Defined Buttons
Using the Python Code Object
Using the Python Result Object
Additional Resources
Mechanical APIs
Mechanical API Introduction
API Reference Guide
Mechanical API Notes
Mechanical API Migration Notes
Mechanical API Known Issues and Limitations
Object Access
Property Types
Tree
Model Objects
Accessing and Manipulating the Geometry Object
Accessing and Manipulating the Mesh Object
Accessing and Manipulating the Connections Object
Accessing and Manipulating the Analysis Object
Analysis Settings Object
Object Traversal
Traversing the Geometry
Traversing the Mesh
Traversing Results
Property APIs for Native Tree Objects
Details View Parameters
Solver Data
Getting Global Items for Solver Data
Getting Object-Specific Data
Getting Object-Specific Data for Imported Objects
Boundary Conditions
Input and Output Variables
Variable Definition Types
Setting Input Loading Data Definitions
Setting Variable Definition Types
Creating a Displacement and Verifying Its Variable Definition Types
Changing the Y Component from Free to Discrete
Changing the Y Component Back to Free
Setting Discrete Values for Variables
Controlling the Input Variable
Controlling the Output Variable
Adding a Load
Extracting Min-Max Tabular Data for a Boundary Condition
Setting the Direction of a Boundary Condition
Worksheets
Named Selection Worksheet
Defining the Named Selection Worksheet
Adding New Criteria to the Named Selection Worksheet
Mesh Order Worksheet
Defining the Mesh Worksheet
Adding New Rows in the Mesh Worksheet
Meshing the Named Selections
Working with Weld Worksheet
Layered Section Worksheet
Bushing Joint Worksheet
Getting the Bushing Joint Worksheet and Its Properties
Getting the Value for a Given Component
Condensed Part Worksheet
Graphics
Setting Graphics View Options
Setting the Display Options for Annotations
Result Vector Display Options
Manipulating Graphics
Exporting Graphics
Exporting Result or Probe Animations
Creating Section Planes
Inserting Image Plane
Setting Model Lighting Properties
Manage Views with Model View Manager
Results
Adding Results to a Solution Object
Accessing Contour Results for an Evaluated Result
Accessing Contour Results from an Evaluated Result
Accessing Contour Results Scoped to Faces, Elements, or Nodes
Accessing Contour Results Scoped to Paths
Accessing Contour Results for Surfaces
Accessing Contour Results for Beams
Limitations of Tabular Data Interface
Set Result Display Options
Working with Legends
Global Legend Settings
Result-Specific Legend Settings
Standalone Legend Settings
Other APIs
Mechanical Interface and Ribbon Tab Manipulation
Command Snippets
Object Tags
Solve Process Settings
Message Window
Ray Casting on Geometry
Interacting with Legacy JScript
Data Processing Framework
Scripting Examples
Script Examples for Selection
Select Geometry or Mesh in the Graphics Window
Get Tree Object of a Body Corresponding to a Selected Body
Get GeoData Body Corresponding to a Tree Object of a Body
Query Mesh Information for Active Selection
Use an Existing Graphics Selection on a Result Object
Calculate Sum of Volume, Area, and Length of Scoped Entities
Create a Named Selection from the Scoping of a Group of Objects
Create a Named Selection that Selects All Faces at a Specified Location
Rescope a Solved Result Based on the Active Node or Element Selection
Scope a Boundary Condition to a Named Selection
Add a Joint Based on Proximity of Two Named Selections
Print Selected Element Faces
Get Normal of a Face
Create a Selection Based on the Location of Nodes in Y
Create Aligned Coordinate Systems in a Motor
Script Examples for Interacting with Tree Objects
Delete an Object
Refresh Tree and Pause Tree
Clear the Mesh
Get All Visible Properties for a Tree Object
Parametrize a Property for a Tree Object
Create Construction Lines from Cylindrical Faces
Update Geometries for all Construction Lines
Create Material Assignment from Body Materials
Count the Number of Contacts
Suppress Duplicate Contacts
Verify Contact Size
Set Pinball to 5mm for all Frictionless Contacts
Use a Named Selection as Scoping of a Load or Support
Suppress Bodies Contained in a Given Named Selection
Rename a Named Selection Based on Scoping
Modify the Scoping on a Group of Objects
Change Tabular Data Values of Loading Condition
Duplicate an Harmonic Result Object
Retrieve Object Details Using SolverData APIs
Evaluate Spring Reaction Forces
Export a Result Object to an STL File
Export Result Images to Files
Tag and Group Result Objects Based on Scoping and Load Steps
Work with Solution Combinations
Create a Pressure Load
Create a Convection Load
Create Node Merge Object at a Symmetry Plane
Access Contour Results for an Evaluated Result
Write Contour Results to a Text File
Access Contour Results at Individual Nodes/Elements
Set Arbitrary Coordinate System Properties
Transform Coordinate Systems (with Math)
Select Objects By Name
Export Figures
Script Examples for Interacting with the Mechanical Session
Remesh a Model Multiple Times and Track Metrics
Perform Solution While Specifying Solution Handler and the Number of Cores
Scan Results, Suppress Any with Invalid Display Times, and Evaluate
Check Version
Check Operating Environment
Search for Keyword and Export
Modify Export Setting
Pan the Camera
Functions to Draw
Export All Result Animations
Get User Files Directory
Display an Arrow at the Centroid of Selected Faces
Compute Shortest Distance Between Two Faces
Display Extensions Loaded in Mechanical
Script Examples for Interacting with Results
Retrieving Stress Results
Creating Probe Principal Stresses from a Node Selection
Finding Hot Spots
Working with Line Charts
Create Hierarchical Data Format File with Velocity Results Using DPF
Examples Using the Python Code Object
After Object Changed Filtering
Send a Warning Message
Export Displacements
Update Following Mesh Generation
Check Property Values
Change Material Property
Print Message to ACT Log
Property Provider Example
Parameterize Coordinate System Transformation
Specify and Parameterize Bolt Pretension Loads
End-to-End Analysis Examples
Static Structural Analysis
Static Structural Spatially Varying Load Analysis
Transient Structural Analysis
Static Structural General Joint Analysis
Static Structural Universal Joint Analysis
Transient Structural Cylindrical Joint Analysis
Symmetric Symmetry Analysis
Linear Periodic Symmetry Analysis
Cyclic Symmetry Analysis
Steady-State Thermal Analysis
Transient Thermal Analysis
Coupled Field Static Analysis
Coupled Field Harmonic Analysis
Coupled Field Transient Analysis
Coupled Field Modal Analysis
Fracture Analysis: Semi-Elliptical Crack
Fracture Analysis: SMART Crack Growth
Fracture Analysis: Contact Debonding
Fracture Analysis: Interface Delamination
Harmonic Acoustic Analysis
Modal Acoustic Analysis
Structural Optimization (Density Based) Analysis
Structural Optimization (Level Set Based) Analysis
Structural Optimization Lattice Analysis
Structural Optimization Shape Optimization Analysis
Rigid Dynamics: Contact Specification
Rigid Dynamics: Flexible Part Specification
Rigid Dynamics: General Analysis
Rigid Dynamics: Joint Specification
Rigid Dynamics: Variable Load Specification
Steady State Electric Conduction Analysis
Steady-State Thermal-Electric Conduction Analysis
Magnetostatic Analysis
Post Processing Options
Post Processing User Defined Results
Random Vibration Analysis
Static Structural Analysis using External Model