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.