Use the Set variables dialog to define SOLIDWORKS PDM Dispatch variables that evaluate when a Dispatch action runs.
To display this dialog box:
Click Variables in the Edit Action dialog box or select .
Use variables in your scripts to store and manipulate values. You might find it useful to store the name of the selected file or the value of a file's data card, for example. You can build variables by combining predefined variables or user-defined variables. For example, if a variable Release
is set to %Number%_%Rev%.pdf
, the value of Release
is derived by evaluating the variables Number
and Rev
. For example, if Number
is 4 and Rev
is 2, then Release
is set to 4_2.pdf
.
Variables are formatted as strings with the variable name enclosed in "%" signs. For example, "%PathToSelectedFile%"
evaluates to the path and filename of the currently selected file when the Dispatch action runs.
The Set variable dialog prompts you with specific fields depending upon the types of the variables you are creating. For example, if you create a new variable of type Static string
, a text field labeled Value prompts you for the string value.
Variables |
Lists the name and information for all user-defined variables. |
Add |
Click to add a new user-defined variable. |
Remove |
Click to remove an existing user-defined variable. |
Name |
Specifies the name for the user-defined variable. This variable name is then referred to by enclosing it between "%" signs, for example, %VersionValue% . The name you specify must not duplicate predefined file variables.
|
Type |
Lets you select the type of variable to be used. Depending on the selected type, different option fields display to further specify the type. |
Value |
Enter a value for the variable. Click to select predefined string functions, arithmetic functions, and variables. |