Configure an Automation Script Adapter for the Structural Simulation

Set up a Visual Basic (VB) module that varies the design of the water bottle's midsection. You pass values between the VB module and the simulation process by mapping parameters to the arguments of a function in the VB module.

Setting up a script as part of a simulation process allows you to automate changes to a model's geometry.

In this example, you set up a VB module to automate changes to the water bottle's midsection. The midsection is defined by a publication, which is controlled by a parameter in the simulation process. When the simulation process runs, the VB module uses the parameter as a function argument to select which midsection design to enable.

  1. From the 3DEXPERIENCE Operations section of the action bar, click Automation Script , and drop it onto the process diagram.
  2. In the process diagram, click the Automation Script adapter to open its shortcut toolbar, and then click to open the adapter's editor.
  3. From the Select Object options, select Parameter.
  4. Create a parameter for the bottle model used in the structural simulation that you previously imported.
    1. Click to search for the bottle model used in the structural simulation that you previously imported.
    2. In the top bar, search for and select PlasticBottleStructural A.1.

      PlasticBottleStructural A.1 is the water bottle model used in the structural simulation.

      The Create New Parameter dialog box appears and the selected object appears in the Object Selection field.
    3. Enter Structural Product for the parameter's name.
    4. Click OK.
      Optimization Process Composer creates an object parameter for the bottle. You can now refer to the bottle using this parameter, which makes it easy to edit the model later on, if required.
    5. From the Select Object options, confirm that Structural Product is selected.
  5. From the App to open options, select Part Design.

    While the simulation process runs, the Automation Script adapter uses Part Design to alter the water bottle's midsection geometry.

  6. In the VBScript Macro Options section, select Content from the Macro library options.
  7. From the Macro library section, click .
  8. Search for and select MidsectionChange.

    If you have no other macro libraries, this field autofills after you click Select.

  9. Enter Module1 for the Macro name.

    Important: The name of the macro must match the name defined in the VB module.

  10. Accept the default name of the Function.
  11. Create a parameter to drive the VB module argument, selecting the bottle's midsection geometry.
    1. From Select function argument, click to create a parameter.
    2. Enter MidsectionDesign as the parameter's name.

      Important: The name of this parameter must match the name defined in the VB module.

    3. From the Type options, select Integer.
    4. Enter 1 for the Value.
    5. Accept all other defaults, and click OK.
    6. Click Add argument.
      The function argument appears in the table.
  12. Create an object parameter to represent the midsection of the bottle used in the structural simulation.
    1. Select Capture object in.
    2. Click to create a parameter.
    3. Enter Structural Midsection as the parameter's name.
    4. Accept all other defaults, and click OK.
    5. From the Capture object in options, confirm that Structural Midsection is selected.
  13. Click OK.
    When you run the simulation process later on, the VB module selects between three different midsection geometries to be used during the structural simulation. The image below shows three water bottle designs, each with a different midsection geometry.

  14. In the top-right corner of the 3D area, click the Process Details panel.
    The Process Details dialog box appears, displaying the name of the simulation process and a description.
  15. Rename the simulation process Bottle DOE Simulation Process, and minimize the dialog box.
  16. In the top bar, click Share , and select Save > Save All to save your work.

    Tip: You can also press Ctrl+S to save your work. Save your work often.