Create the Visual Basic Library

Create a Visual Basic (VB) library on the 3DEXPERIENCE platform, and import the VB modules.

Macros allow you to automate a series of functions and group them as a single command. Macros can be written in the VB scripting language. The VB modules that you previously downloaded from the Dassault Systèmes Knowledge Base contain scripts that automate modifications to geometry by altering the values of the publications in the model.

In this example, you use VB modules to alter a portion of the water bottle's geometry and create multiple water bottle designs.


Before you begin: Confirm that you are in the Simulation Finder app or any app in which you can edit VB libraries.
  1. Create a macro library to contain the VB modules that you previously downloaded from the Dassault Systèmes Knowledge Base.
    1. From the Tools section of the action bar, click to show more options, and click Macros .
    2. Click Macro libraries.
    3. From the Library type options, select PLM VBA projects.
    4. Click Create new library.
    5. Enter MidsectionChange as the Title.
    6. Click OK.
    7. Close both the Macro libraries and Macros dialog boxes.
  2. From the Tools section of the action bar, expand Macros , and select Visual Basic Editor .
    Microsoft® Visual Basic opens in a new window. The left-hand panel displays the VB library that you created.
  3. Add the VB modules that you previously downloaded to your VB library.
    1. From the left-hand Project panel, right-click the MidsectionChange library, and click Import file.



    2. Locate Module1.bas, and click Open.
    3. Similarly, import Module2.bas into the project.
    4. In the toolbar, click Save to save the VB library.
    5. Close Microsoft Visual Basic.
    The VB library that you created now contains two VB modules, one module for each type of simulation in the simulation process. Each module contains a script that alters the geometry of the water bottle before you run the simulation process.
  4. From the Compass, open Optimization Process Composer.

    Tip: You can use the search field to find the app.

    The app creates a simulation process.