Skip to main content

Basic scripting

The scripting language of ACP is Python, an object oriented programming language. It is recommended that you have some basic experience in object oriented programming for optimal use of the APIs, but a basic script can easily be written by modifying an existing one or using copy and paste from the History or Shell view. An example of one command is given below. In this command, the density of the material Corecell_A450 is defined (or modified if already defined) as 90.
The easiest way to use scripting is to generate a script with the Graphical User Interface. Every action performed via the GUI is written to the History view. Use the copy and paste feature to create your own scripts with a text editor. Save the scripts as *.py file and use the Run Script… functionality in the File Menu to run your script. In the case of an error, check the Shell view for more details. The aforementioned approach may be limited when it comes to retrieving solution results or specific model information. The section Advanced scripting lists several examples of to how to access such information via a script. Additionally, an example of a Python script is given in the Class40 example folder in the ACP installation directory. The update_materials.py file defines stress limits, Puck, and Tsai-Wu constants for the UD and core materials. A list of common commands used to retrieve or modify data is shown below.

Advanced scripting

These examples are provided as a guide to more involved commands in the shell view. They all refer to the example model Kiteboard.

Maximum layup thickness

Maximum ply thickness

Maximum inverse reserve factor and failure mode