You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


We will in this tutorial focus mostly on the scripting features available in APDL, as they are one of the main reasons to use APDL instead of other more graphical programs.

We will in this tutorial assume that you are familiar with general programming features like variables, loops, statements etc.


The Ansys finite element solvers enable a breadth and depth of capabilities unmatched by anyone in the world of computer-aided simulation.  Thermal, Structural, Acoustic, Piezoelectric, Electrostatic and Circuit Coupled Electromagnetics are just an example of what can be simulated.  Regardless of the type of simulation, each model is represented by a powerful scripting language … the Ansys Parametric Design Language (APDL).  APDL is the foundation for all sophisticated features, many of which are not exposed in the Workbench Mechanical user interface.  It also offers many conveniences such as parameterization, macros, branching and looping, and complex math operations.  All these benefits are accessible within the Ansys Mechanical APDL user interface. 

Page content

How to run scripts in APDL

Scrips in APDL are usually executed by the use of one of two methods. The first method is to write (or copy & paste) your code directly into the command window available in APDL.

The other method is to read in an input file containing your script. To do this, go to File → Read Input From, select the correct file form the menu and click OK.

Introduction to APDL commands

Although many APDL commands are similar to what we are familiar with from other programming languages, very few have the exact same syntax. This means that to fully understand your code, and to further improve it, you will have to read the APDL commands documentation.

The easiest way to locate the correct documentation is to open Mechanical APDL and click Help → Help Topics. Since we will focus on the scripting part of APDL, the Command reference documentation is the most relevant to us.




  • No labels