More command line scripts

In this task, you will explore the other VB scripts that are installed with Autodesk Moldflow Insight, and learn how to access the help documentation for some of the other VB scripts.

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

  2. When the Command Line dialog appears, type HELP into the text field and click Go.

  3. A text file opens. This file contains a brief description of the function of each VB script that is supplied with the product. Read through the file to learn what other functionality is available through these VB scripts.

    Close the text file when you have finished.

  4. Some of the VB scripts that are installed with Autodesk Moldflow Insight require you to enter parameter values when you invoke the script from the command line. You will now investigate one such script, and will learn how to find out which other scripts require these values. Ensure the Command Line dialog is open.

  5. Type HELP DT into the text field and click Go.

  6. A dialog opens. This dialog contains a synopsis of the information necessary to run the script successfully, including:

    • Information about what function the script performs (DESCRIPTION)
    • Information about what you must type in on the command line to launch the script (SYNTAX)
    • Information about any parameter values that you need to type in on the command line when you run the script (PARAMETERS)
    • Any further information about the script (NOTES)
  7. You can see that the DT script translates (pans) the model horizontally and/or vertically.

  8. Click OK to close the information dialog.

  9. Type DT into the Command Line dialog and click Go.

    A dialog appears stating that insufficient arguments were supplied. Read the comments on the dialog and then click OK. The script failed to run because no translation values between -1 and 1 were entered. You will now enter these values and rerun the script.

  10. Click OK to close the information dialog.

  11. Type DT 0.5 0.5 into the text field on the Command Line dialog and click Go.

    The first value is the translation amount in the horizontal direction, while the second value is the translation amount in the vertical direction. The model will be translated half way across the screen to the right and half way up the screen.

  12. Type DT 0.5 into the text field on the Command Line dialog and click Go.

    The model will now be translated across the remaining right half of the screen until it is completely out of sight.

  13. Type DT -1 -0.5 into the text field on the Command Line dialog and click Go.

    The model will be translated back to the center of the screen.

    Note: To learn whether any other scripts require command line parameters, type
    HELP (followed by script name)

    in the Command Line dialog. The resulting dialog will explain what parameters (if any) are required. Some scripts, such as the INJPTS_3D script that you ran earlier in this tutorial, do not require any command line parameters.

More detailed information on the API is provided in the API section of the online help. There you will find extended information about how to use the API, examples of API VB scripts, references for Visual Basic programming, and the API command reference.