FlexScan3D User Manual - Version 3.3.4.x

You are here: API/SDK and Automation > Automation > Working with Scripts

Working with Scripts

Running an Individual Command

Running an individual command is an easy way to quickly test a command without saving a new script.

To run an individual command:

1. Type the script commands into the textbox at the bottom of the script editor.
2. Click Execute or press ENTER to execute the command.

Creating a New Script

To create a new script:

1. Click New.

Save As dialog will open. By default, the FlexScan3DScripts folder will be used, but you can choose a different folder.

2. Type a file name for your script and click Save.
3. Edit your script in the text editor that will open.
4. Save your script when you have finished.

The script will automatically be added to the list of scripts in the New drop-down.

Editing an Existing Script

To edit an existing script:

1. Click the drop-down arrow next to the New button and select a script to load it.

You can also browse for a script by clicking Browse... in the drop-down.

2. Click Edit to open the selected script in your default text editor.

Each time you click the Edit button, the script currently selected in the New drop-down will open for editing.

Running a Script

To run a script:

1. Click the drop-down arrow next to the New button and select a script to load it.

You can also browse for a script by clicking Browse... in the drop-down.

2. Click Run to run the selected script.

Each time you click the Run button, the script currently selected in the New drop-down will run.

3. Check the Script Output window for logged output results.

You can also run scripts from a command line. Refer to the script command-line arguments for more information.

Setting Script Buttons and Hot Keys

You can add buttons to the FlexScan3D interface to launch functions quickly and easily. You can also set hot keys to launch scripts. See Working with Scripts for more information on functions.

Script Buttons

To add a script button:

1. Click on the Add Script Button button in the lower right corner of FlexScan3D.

2. Navigate to the location of the script for which you want to add a button. A button will be added in the right side of the status bar. Clicking on the button will launch the script.

To remove a script button, right click on the button and choose Remove Button.

Hot Keys

To set hot keys to launch scripts:

1. Create a script that contains one or more calls to the SetHotKey(name, key, script, description) function.
2. Run the script.

Alternatively, you can run the function in the Script Editor.

A button and drop-down list will be added in the right side of the status bar. The drop-down list contains a list of all active hot keys. Each time you run a script that calls the SetHotKey(name, key, script, description) function, new hot keys will be added to the list.

Hot keys are not persistent. When you relaunch FlexScan3D, the hot keys will no longer be active. However, you can set a script that adds hot keys to run automatically whenever FlexScan3D launches.

To automatically adds hot keys whenever FlexScan3D launches:

1. Open the Script Editor.
2. Load the script that sets hotkeys using SetHotKey(name, key, script, description).
3. In the New drop-down list, select Set As Startup Script.

Each time that FlexScan3D is launched, the script will be run and the hot keys will be added.

To remove a hot key, use the UnsetHotKey(key) function.

 

 

 

Copyright © 2015 LMI Technologies, Inc. All rights reserved.