Visual Basic for Applications (VBA) Script
You can pass values between the simulation process and the VBA script by mapping parameters to the arguments of a function in the script. For example, you can use the script to create a physics simulation object and all the features of a simulation, such as the material definitions, the loads, and the finite element model (FEM). You can control the value of simulation objects, such as loads, by passing parameters to the arguments of a function in the script.
Similarly, you could create a design of experiments that runs a simulation designed to measure the peak stress around a hole. You could control the diameter of the hole in the part in each simulation by passing in a radius parameter to a VBA script that runs a 3D Modeling app.
In most cases, you create a VBA script by recording your actions while interacting with a dialog box in a 3D Modeling app. You can create a macro library of type PLM VBA projects in which to store your macro.
VBA macros recorded from your interactions with a dialog box are of type
MS VBA, by default, no arguments pass into a recorded VBA
macro. To pass in arguments, you must edit the function definition. The following
example shows a Radius argument added to the function definition:
Sub CATMain(Radius As Long)
You can define which parameters to pass in as arguments to the function. Parameters appear in the Automation Script Editor in the same order in which they pass into the function.
You cannot record your interactions with a physics simulation dialog box. However, you can create a VBA macro that operates on a simulation by entering the commands into a text editor.
When Optimization Process Composer runs the Automation Script adapter, it starts a 3DEXPERIENCE client in the background; however, a 3DOrchestrate Station can run only a single 3DEXPERIENCE client at a time. Therefore, the VBA script runs only if a 3DEXPERIENCE client is not already running on the same machine that is running the 3DOrchestrate Station, and you cannot run the adapter in parallel.