Skip to main content

Basic scripting

ACP uses Python as its scripting language. Because the API is object‑oriented, having basic experience with object‑oriented programming is helpful. However, you can often start by copying and adapting commands from the History or Shell views. The following example shows how to define or update the density of the material Corecell_A450:
A simple way to begin scripting is to generate commands through the graphical user interface (GUI). Every action you perform in the ACP GUI is recorded in the history view. You can copy these commands into a text editor, save them as a *.py file, and run the script using File > Run Script…. If a script fails, check the Shell view for error details. This approach is useful for basic automation but limited for tasks such as querying solution results or retrieving detailed model information. For more advanced tasks, see the examples in Advanced scripting. ACP also provides example scripts in the ACP installation directory. For instance, the update_materials.py script (in the Class40 example folder) defines stress limits and Puck and Tsai‑Wu constants for UD and core materials. Below are several commonly used scripting patterns for retrieving or modifying data.

Advanced scripting

These scripts illustrate more advanced operations using the example Kiteboard model. Each example shows how to query specific information from the active model.

Maximum layup thickness

Maximum ply thickness

Maximum inverse reserve factor and failure mode