The command line

In this task, you will run a VB script from the Command Line to set multiple injection points on the model.

  1. Ensure the cushion_3D study used in the previous task is open.

  2. Using the ViewCube click Front View .

  3. Click facing surfaces (Geometry tab > Selection panel > Select Facing Entities) to ensure that only the elements facing you will be selected.

  4. Click select entities (Geometry tab > Selection panel > Select Enclosed Entities) to ensure that only the elements that are fully enclosed within a banding box will be selected.

  5. Click select circle (Geometry tab > Selection panel > Circle).

  6. Click and drag the cursor starting at the node in the center to select the nodes and elements shown in the following image.

    api selection

  7. Click ui icon (View tab > Windows panel > User Interface) and select Command Line from the drop-down menu.

  8. Type INJPTS_3D and click Go, or press Enter.

    Note: When entering the name of a command script in the Command Line dialog, do not include the file extension (*.vbs).
  9. If you are asked whether you want to Use Injection Face Normal: 0, 0, 1? , click Yes.

  10. When the script has finished, a Completed dialog appears. It states 19 nodes selected . Click OK on this dialog.

    You should see that injection points have been inserted at all of the nodes you selected.

  11. Click orbit icon Orbit to rotate the image so that you can see the injection points clearly.

    Tip: You can verify that these commands have been run by clicking history icon Action History on the Quick Access toolbar.
  12. View the Visual Basic code for this script by using Windows Explorer and a text editor.

    Note: If you installed the software in the default installation directory, the INJPTS_3D script will be located at C:\Program Files\Autodesk\Moldflow Synergy 20XX\data\commands\injpts_3d.vbs.

    This script is one of a set of scripts that are installed automatically. This package of pre-written scripts is stored in the Commands folder. Any VB scripts that you write yourself or record using the Record Macro function are stored by default in the My Documents\My AMI 20XX Projects directory.

  13. Click front view icon Front View on the ViewCube to return the model to the front view.

In the next task, you will learn about the other command line scripts that are installed with the product.