You are on page 1of 30

PDMWorks Enterprise Dispatch Guide

1995-2006, SolidWorks Corporation 300 Baker Avenue Concord, Massachusetts 01742 USA All Rights Reserved U.S. Patents 5,815,154; 6,219,049; 6,219,055; 6,603,486; 6,611,725; 6,844,877; 6,898,560; 6,906,712 and certain other foreign patents, including EP 1,116,190 and JP 3,517,643. U.S. and foreign patents pending. SolidWorks Corporation is a Dassault Systemes S.A. (Nasdaq:DASTY) company. The information and the software discussed in this document are subject to change without notice and should not be considered commitments by SolidWorks Corporation. No material may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose without the express written permission of SolidWorks Corporation. The software discussed in this document is furnished under a license and may be used or copied only in accordance with the terms of this license. All warranties given by SolidWorks Corporation as to the software and documentation are set forth in the SolidWorks Corporation License and Subscription Service Agreement, and nothing stated in, or implied by, this document or its contents shall be considered or deemed a modification or amendment of such warranties. SolidWorks, PDMWorks, 3D PartStream.NET, 3D ContentCentral, eDrawings, and the eDrawings logo are registered trademarks of SolidWorks Corporation, and FeatureManager is a jointly owned registered trademark of SolidWorks Corporation. SolidWorks 2007 is a product name of SolidWorks Corporation. COSMOSXpress, DWGeditor, DWGgateway, Feature Palette, PhotoWorks, and XchangeWorks are trademarks of SolidWorks Corporation. COSMOS and COSMOSWorks are registered trademarks, and COSMOSMotion and COSMOSFloWorks are trademarks of Structural Research & Analysis Corporation. FeatureWorks is a registered trademark of Geometric Software Solutions Co. Limited. ACIS is a registered trademark of Spatial Corporation. GLOBEtrotter and FLEXlm are registered trademarks of Globetrotter Software, Inc. Other brand or product names are trademarks or registered trademarks of their respective holders. COMMERCIAL COMPUTER SOFTWARE - PROPRIETARY U.S. Government Restricted Rights. Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227-19 (Commercial Computer Software - Restricted Rights), DFARS 227.7202 (Commercial Computer Software and Commercial Computer Software Documentation), and in the license agreement, as applicable. Contractor/Manufacturer: SolidWorks Corporation, 300 Baker Avenue, Concord, Massachusetts 01742 USA Portions of this software 1999, 2002-2006 ComponentOne Portions of this software 1990-2006 D-Cubed Limited. Portions of this product are distributed under license from DC Micro Development, Copyright 1994-2006 DC Micro Development, Inc. All rights reserved Portions of this software 1998-2006 Geometric Software Solutions Co. Limited. Portions of this software are 1997-2002 Macromedia, Inc. Portions of this software 1986-2006 mental images GmbH & Co. KG Portions of this software 1996-2006 Microsoft Corporation. All Rights Reserved. MoldflowXpress is 2005 Moldflow Corporation. MoldflowXpress is covered by US Patent No. 6,096,088 and Australian Patent No. 721978.

Table of contents
Introduction.......................................................................................................................................................4 Installation........................................................................................................................................................4 Installing dispatch for 64 bit operating systems............................................................................................4 Administrate Actions.........................................................................................................................................6 Dispatch Examples.......................................................................................................................................8 Edit action.........................................................................................................................................................9 Create the Command script............................................................................................................................12 Commands.....................................................................................................................................................13 Cancel PDMWorks Enterprise command....................................................................................................13 Combo box..................................................................................................................................................13 Check in file.................................................................................................................................................13 Check out file...............................................................................................................................................14 Copy file......................................................................................................................................................14 Create folder................................................................................................................................................15 Delete file.....................................................................................................................................................15 Edit box.......................................................................................................................................................15 For all documents .......................................................................................................................................16 End for all documents.................................................................................................................................16 For all configurations..................................................................................................................................16 End for all configurations............................................................................................................................16 Generate parameter file...............................................................................................................................16 Get file.........................................................................................................................................................18 Jump...........................................................................................................................................................18 Label...........................................................................................................................................................18 Move local folder.........................................................................................................................................19 OK messagebox..........................................................................................................................................19 Send message.............................................................................................................................................20 Rename file.................................................................................................................................................20 Shell execute...............................................................................................................................................21 Wait.............................................................................................................................................................21 Write registry value.....................................................................................................................................22 Yes-No message box...................................................................................................................................22 Variables.........................................................................................................................................................24 User-defined variables.................................................................................................................................24 Pre-Defined Dispatch Variables...................................................................................................................27 File Variables..............................................................................................................................................29

Page 4 of 30

INTRODUCTION
PDMWorks Enterprise Dispatch is a module to further automate tasks and processes in PDMWorks Enterprise. The module is fully customizable and configurable to accommodate support for any type of task or process. PDMWorks Enterprise Dispatch integrates seamlessly into a PDMWorks Enterprise file vault and can be made to trigger on a number of events in PDMWorks Enterprise. For instance, whenever a document reaches a certain workflow state, PDMWorks Enterprise Dispatch is triggered and starts up a script that creates a PDF- file of the document.

INSTALLATION
Note. PDMWorks Enterprise Dispatch is an add-in module and can only be installed by a user with sufficient rights to install and administer add-ins. Once installed, the module will be distributed and available from any client connected to the file vault in which it was installed. 1. Extract the file Dispatch.dll to a temporary folder. (Note. Dispatch is located on the install CD under \Support\Dispatch ) 2. Open PDMWorks Enterprise Administration tool and expand the vault where Dispatch should be installed. 3. Right click on Add-ins and select Open. 4. Click the button New and browse to the extracted Dispatch.dll file. Select the file then click Open. 5. When PDMWorks Enterprise Dispatch is loaded, the Administrate Add-ins dialog will look as follows.

6. Click OK to close the dialog. Installing dispatch for 64 bit operating systems

Page 5 of 30

If you plan on using dispatch on 64 bit operating systems, you must also add the Dispatch64.dll file in order for dispatch to work on these systems. To do this: 1. Open the administration tool on a 64 bit operating system. 2. Right-click Add-ins and select Open. If the 32 bit (Dispatch.dll) module is already added, press the Add Files button and add the Dispatch64.dll file as well. If no dispatch add-in is added yet, press the New button and select both Dispatch.dll and Dispatch64.dll (CTRL-select both files). 3. When correctly added, the File name section should list both files:

Page 6 of 30

ADMINISTRATE ACTIONS
To access the PDMWorks Enterprise Dispatch administration tool, do as follows: Note. Only the PDMWorks Enterprise Admin user will have the Tools menu option available other users must use the administration tool option. 1. Log in as Admin in the file vault where PDMWorks Enterprise Dispatch is installed. 2. Select in the menu, Tools => Administrate actions.

Or: 1. Open the administration tool and expand the file vault log in as a user that has permission to administrate add-ins 2. Expand add-ins and right-click on the Dispatch.caf add-in. Select Administrate actions.

Page 7 of 30

The Administrate Actions dialog will show:

The Administrate Actions dialog: Installed actions Lists the available Dispatch action scripts. Add Click to add a new Dispatch action. Edit Select an existing action in the list and click Edit to modify the action. Remove Select an action from the list and click Remove to delete the action. Load Click to import an exported Dispatch action file (.acn). Save Select an action from the list and click Save to export the action to a file (.acn) Copy Select an action from the list and click Copy to copy the action. Paste Paste a previously copied action.

Page 8 of 30

Dispatch Examples You will find a selection of various dispatch script examples on the install CD under \Support\Dispatch\Dispatch Examples. Note: The scripts and sample tools are delivered as is and should be used as reference only. To import an example script, do as follows: 1. Open the Administrate actions dialog. 2. Click the Load button and select the .acn dispatch script to import.

3. The script will be imported and you can modify or save it as needed.

Page 9 of 30

EDIT ACTION
To define a new PDMWorks Enterprise Dispatch action (or edit an existing one) open the Edit action dialog: 4. Open the Administrate actions dialog. 5. Click the Add button. 6. The Edit Action dialog shows.

The Edit action dialog: Action name Enter a name for the action (will show in the Installed action list of the previous dialog). Description Enter a description of the action. Menu command Tick the box to show the entered menu command that should activate the action. The menu command will be available in the right mouse button menu for users logged in to the file vault During state If you want the action to activate every time file vault files reach a certain workflow transition state, tick the box and click the Conditions button. The following dialog appears:

Page 10 of 30

During check out

Enter in which path files should reside that will trigger the action. Use % as wildcard character (a single % will trigger the action on files in the whole vault). Select in the drop down list, which target workflow state should trigger the action (i.e. selecting Engineering Workflow.Approved will start the action every time a file in the specified path is sent to the Approved state in the Engineering workflow). Select if the action should trigger after (default) or before the state is changed on the file.

If you want the action to activate every time a files mode is changed (Check out, check in etc.), tick the box and click the Conditions button. The following dialog appears:

During add

Enter in which path files should reside that will trigger the action. Use % as wildcard character (a single % will trigger the action on files in the whole vault). Select in the drop down list, which file mode should trigger the action (i.e. selecting Check in will start the action every time a file residing in the specified path is checked in). Select if the action should trigger after (default) or before the condition is changed on the file. Note that if a file is checked in without any changes made to it, it will trigger an undo check out condition.

If you want the action to activate every time a file is added to the file vault, tick the box and click the Conditions button. The following dialog appears:

Page 11 of 30

Commands Add Remove Edit Move up Move down Variables

Enter in which path files should reside that will trigger the action. Use % as wildcard character (a single % will trigger the action on files in the whole vault). Select if the action should trigger after (default) or before the add operation is completed.

Lists the commands that should be performed whenever the action is activated. The list is evaluated from top to bottom. Click to add a new command (see Commands below) Select a defined command in the list and click to remove this command. Use CTRL to select multiple commands. Select a defined command in the list and click to modify the parameters of the command (see Commands below). Moves a selected command up one line in the command list. Moves the selected command down one line in the command list. Click to edit the dispatch variables (see Variables below).

Page 12 of 30

CREATE THE COMMAND SCRIPT


When the Dispatch action is triggered, the command script will start evaluating a set of commands. To add commands do as follows. 1. Click the Add button 2. Use the drop-list in the Select command dialog to select which command to add.

3. Depending on which command is selected (see description of commands below) a second dialog will show where you enter specifics related to the command.

4. Click OK. 5. Add the next command until you have completed the script.

Page 13 of 30

COMMANDS
The following commands are available in PDMWorks Enterprise Dispatch: Note! In all command dialog strings, variables are included by enclosing the variable name with % signs (for example the string The drawing: %DrawingNumber% is plotted, where %DrawingNumber% is 1234 will when evaluated read The drawing: 1234 is plotted) Also, all paths entered MUST be exact paths. Use % as wildcard. For example %\PROJECT\% will trigger for the path c:\PDMWorks Enterprise views\Vault\PROJECTS\ Cancel PDMWorks Enterprise command Adding this command to the script will stop the current PDMWorks Enterprise event that triggered the dispatch action. For example, if dispatch is set to trigger when a document is approved, and the file being approved must contain a certain variable you can add a jump in the script that cancels the state change if the variable is not found. Combo box Displays a dialog to the user with a drop-down list containing choices. The selected list item is stored in a Dispatch runtime variable for later use. Combo box settings Prompt string Enter a string that should be shown to the user when the command is evaluated. Variable name Select a Dispatch runtime variable to store the user selected choice in. Select from defined runtime variables in the list or click to define a new variable. (A runtime variable is a temporary container to hold the value that is chosen in the combo box. You can then re-use that value by using the runtime variable). Selectable choices Click the Add button to add a new choice presented to the user when the combo box is shown. Select in the list and click the Remove button to remove a choice.

User dialog shown when the above combo box is evaluated:

Check in file Checks in a file (in the file vault) that is checked out by the current user.

Page 14 of 30

If changes have been made to the file, a new version is created using the check in comment defined in the dialog. If no changes have been made to the file, undo check out is performed on the file. If file is not checked out, or checked out by other user, an error dialog will appear. Filename Enter the exact path (including filename) to the file that should be checked in. Click to insert variables.

Check in file settings

Comment Enter the version comment that should be used when checking in the file. Click to insert variables.

Check out file Checks out a file (stored in the file vault) to the user triggering the Dispatch action. Check out file settings Filename Enter the exact path (including filename) to the file that should be checked out for editing. Click to insert variables.

Copy file Copies a file to a defined destination. Note! It is the version of the file that is currently stored in the local cache that will be copied. If no version is cached, the latest available will be copied. Be sure to combine this command with Get file in order to retrieve the correct version. Copy file settings Source file Enter the exact path (including filename) to the source file that should be copied. To add a defined variable click the button (for example a variable containing the selected file path). Destination file Enter the exact path (including filename) to where the copied file should be placed. To select a defined variable click the button (for example a variable containing the destination filename). If the destination already exists, a warning will show.

Page 15 of 30

Create folder Creates a new folder in the specified destination. Note! If folder already exists, a warning message will show when the command is evaluated. Create folder settings Folder name Enter the exact path (including the folder name) to the location where the folder should be created. To add a defined variable click the button (for example a variable containing the folder name).

Delete file Removes a specified file. Delete file settings Filename Enter the exact path (including filename) to the file that should be deleted. To add a defined variable click the button (for example a variable containing the filename). Also remove file from vault If the specified file is stored in a file vault, check this to also remove the file from the vault. If not checked only the cached local copy will be removed.

Edit box Displays a dialog in which the user can enter a value. The value is stored in a runtime variable for later use. Edit box settings Prompt string Enter a string that should be shown to the user when the command is evaluated. Variable name Select a Dispatch runtime variable to store the user answer in. Select from defined runtime variables in the list or click to define a new variable. . (A runtime variable is a temporary container to hold the value that is entered in the edit box. You can then re-use that value by using the runtime variable).

User dialog shown when the above edit box command is evaluated:

Page 16 of 30

For all documents Indicates the start of a block in which the following scripted commands are applied on all selected files, one file at a time. Note! If a block is not specified the scripted commands will only run once, even if multiple documents are selected. For instance if you select 100 files and activate a Dispatch action you do not want to have 100 dialog boxes shown. Most likely you would only like to have one in which you select for example Printer or Plotter and then have all 100 files sent to the selected device. End for all documents Indicates the end of a block of commands starting with For all documents Example: This dispatch action will first show an edit box (once) letting the user enter a destination folder and then evaluate the Copy file command on each of the selected files that has triggered Dispatch. For all configurations Indicates the start of a block in which the following commands will be applied on each of the found configurations (i.e. Layout/model space for dwg files, Configurations for Solidworks files). Note! If the configuration block is not specified, only the default configuration of the file will be evaluated. End for all configurations Indicates the end of a block of commands starting with For all configurations Example: This dispatch action will execute a shell command for each of the found Configurations in the selected file

Generate parameter file Generates a text file containing expanded variable values (for example values from the file data card of the selected files). The content and variables in the generated file is based on a predefined template. Generate parameter file settings

Page 17 of 30

Template Exact path (incl. Filename) of the file that should act as template for the generated file. This ANSI style template should contain static text and dynamic dispatch variable names (%variable%) to be replaced in the generated file. Click to browse for the file.

Filename Enter the exact path (incl. Filename) of the file to be generated. Click an existing file. to browse for

Use counter... Check this to add a unique counter number for each generated file. The counter is added after the filename, before the extension (Export1.txt, Export2.txt). Append to file - Check this to append the results based on the template, if the selected file exists. Assign filename to Select a Dispatch runtime variable to assign the current filename to for later use. . (A runtime variable is a temporary container to hold the value of the parameter file filename. You can then re-use that value by using the runtime variable). Example: 1. This dispatch action will generate a list of the selected files based on the template. The append option is activated, making sure the result is added to the same file. 2. The template file contains one predefined variable that will be replaced with the evaluated variable value at runtime. (Any static text in the template file will remain in the generated file). 3. The Dispatch action is triggered on three selected files.

4. Once the Dispatch action is complete, a text file has been generated containing the filenames (the evaluated variable %NameOfSelectedFile%) of the selected files.

Page 18 of 30

Get file Retrieves a copy of the specified file to the local cache. Use this command to make sure that the latest available file version is used when Dispatch runs. Get file settings Filepath Enter the exact path (including filename) to the file that should be retrieved. To add a defined variable click the button (for example a variable containing the filename). Get latest if missing The file will only be retrieved if it is missing in the local cache. Get latest if missing or earlier version The latest version of the file will be retrieved, regardless of version stored in the cache.

Jump Defines that the command script should perform a conditional jump to a predefined Dispatch command label. Conditional jump settings If Enter the string or variable that should match the defined condition to make the jump (for example if file exists, then jump). Click to add variables.

Conditions (select one): Always Always jump to specified label, even if string is not true. = If string matches below specified string, then jump to specified label. > If string value is greater than below specified string value, then jump to specified label. >= If sting value is greater than, or equal to, below specified string value, then jump to specified label. != If string does not match below specified string, then jump to specified label. Exists as If specified file exists locally, then jump to local specified label. Exists in If specified file exists in vault, then jump to vault specified label. then goto label Select a predefined Dispatch command label to jump to if the defined conditions are met.

Label Defines a Dispatch label in the command script. Label settings

Page 19 of 30

Label name Enter a name for the label (used together with the conditional Jump command).

Move local folder Moves or renames a local folder. Note! Folders stored in the file vault cannot be moved with this command. Move local folder settings Old folder name Enter the exact path (including folder name) to the folder that should be moved. Click insert variables. to

New folder name - Enter the exact path (including folder name) to target location where the folder should be moved. To rename a folder, keep the target path identical to the source but use a new folder name. Click insert variables. to

OK messagebox Displays a message dialog to the user. User will have to click OK to close the dialog. Note! The Dispatch command script is halted until user closes the dialog. OK messagebox settings String to display Enter a string to display in the OK message box. Use the enter key to create a line break. Click to insert variables.

Example: User dialog shown when the above OK messagebox is evaluated:

Page 20 of 30

Send message Sends a simple message to a selected group or user Send message settings To Select which groups or users should receive the message. Subject Enter the message subject. Message Enter the message body. It is possible to use HTML tags in the body. Note that it is not possible to use pre-defined or userdefined variables in either subject or body

Above action will generate the following notification:

Rename file Renames a file

Page 21 of 30

Rename file settings Path to file Enter the exact path (including filename) to the file that should be renamed. Click variables. to insert

New filename Enter the new filename (and extension), without path.

Shell execute Launches a file with optional parameters. Used to, for example, send a file to a .pdf generating program. Shell execute settings Verb System command that should be use to call the specified filename (Open, Edit, Print, Explore, Find ). If no verb is selected, the Open is used by default. Filename Enter the exact path of file to execute, or file to be used with above selected system verb. Click to insert variables.

Parameters Enter any additional parameters that should be sent to the executed file. (for example switches, or name of file to process etc.). Click to insert variables.

Halt execution of script - Check this to have the Dispatch command script halt until shell execute is completed. Wait Halts the Dispatch command script until a certain condition is filled. Wait settings Wait until Select the condition that should let the script continue in the drop-down list: File is created File is deleted Registry value is set Filename Enter the exact path to the file that should be created/deleted for the script to continue. Click to insert variables.

Registry value Enter the exact registry key name that should be created for the script to

Page 22 of 30

continue. Click

to insert variables.

Write registry value Create or update a registry value. Note! The logged in user that triggers Dispatch must have sufficient rights to update the selected registry key. It is recommended to use the HKEY_CURRENT_USER section for this. Write registry value settings Key Enter the full registry key and registry value container that should be updated. If the value container does not exist it will be created. (Keys must exist) Value Enter the value that should be written. Click to insert variables.

String/DWORD Select if value should be stored as string or DWORD in the registry.

Example: 1. Using the following registry key and container: HKEY_CURRENT_USER\Software\SolidWorks\Applications\PDMWorks Enterprise\Vaults\DispatchFile 2. Using the following Value: %NameOfSelectedFile% 3. When the script is run, the following registry value is created and updated with the current name of file that is processed:

Yes-No message box Displays a dialog where user can select Yes or No. The value of the selection is stored in a Dispatch runtime variable for later use. Yes-No Messagebox settings

Page 23 of 30

Prompt string Enter a string that should be shown to the user when the command is evaluated. Variable name Select a Dispatch runtime variable to store the user selected choice value in. Select from defined runtime variables in the list or click to define a new variable. (A runtime variable is a temporary container to hold the value that is chosen in the message box. You can then re-use that value by using the runtime variable). Selectable choices YES value This value will be stored in the defined runtime variable when user selects Yes. NO value - This value will be stored in the defined runtime variable when user selects No. This user dialog is shown when the above Yes-No Messagebox is evaluated. When user clicks the Yes button, the value Y is stored in the Choice variable for later use:

Page 24 of 30

VARIABLES
You can define (and use pre-defined) PDMWorks Enterprise Dispatch variables that will evaluate when the Dispatch action is run. These variables could for example contain the name of the selected file, or the value of a files file data card. Variables are included in strings by enclosing the variable name with % signs, for example %PathToSelectedFile% would evaluate to the path and filename of the currently selected file when the Dispatch action is run. User-defined variables Use the Set variables dialog to set up user defined variables. To access the Set variables dialog, click the Variables button in the Edit action dialog, or select Userdefined Variables => Edit Variables from the predefined variable sub-menu.

The Set variables dialog: Variables Lists the name and information about the user-defined variables Add Click to add a new user-defined variable Name Enter a name for the user defined variable. This variable name is then referred to from command-strings by enclosing it in % signs (for example, the variable above is referred to as %VersionValue% ). Note that the name may not be the same as one of the predefined file variables. Type Select what type of variable should be used. Depending on the selected type, different option fields will appear to further specify the type. The following variable types are available:

Page 25 of 30

Example: You can use the user defined variables section to build up a new variable value that is a combination of several other values. For example, it would be possible to combine the Part Number and Revision of the below file to a single variable.

1. Create a user defined variable Number that reads the part number from the file data card.

Page 26 of 30

2. Create a user defined variable Rev that reads the revision from the file data card.

3. Create a third variable PublishedName using a static string that combines the two other variables into a new value.

4. You can now use the user defined variable in the dispatch script, for example in a message box. Either type the variable name enclosed in % signs, or select it from the button menu :

Page 27 of 30

5. The following message is shown when the dispatch script is run.

Pre-Defined Dispatch Variables When defining Dispatch commands, in most dialog boxes you can access the pre-defined and user defined variables by clicking the button. A submenu will appear listing several pre-defined variables. The following image displays all pre-defined variables accessed from this sub-menu.

String Functions You can manipulate fixed strings and variable values using the string functions. Left Returns the first (leftmost).specified number of characters from a specified string. Syntax Arguments Left(abc, 2) abc The character string, 2 Number of characters Example: Left(ProjectAA, 7) returns Project Right Returns the last (rightmost) specified number of characters from a specified string. Syntax Arguments Right(abc, 2) abc The character string, 2 Number of characters Example: Right(ProjectAA, 2) returns AA

Page 28 of 30

Mid Returns a substring from a specified string (starting at any position) Syntax Arguments Mid(abc, 1, 2) abc The character string, 1 Starting position, 2 Number of characters Example: Mid(ProjectAA,3,2) returns oj Length Returns the length of a specified string. Syntax Arguments Length(abc) abc The character string Example: Length(ProjectAA) returns 9 Reverse Returns the reverse of a specified string. Syntax Arguments Reverse(abc) abc The character string Example: Reverse(stockholm) returns mlohkcots Find Searches a specified string for the first match of a character or substring. Syntax Arguments Find(abc, b) abc The character string, b the character to look for Example: Find(abcdef, c) returns 2 ReverseFind Searches a specified string for the last match of a character. Syntax Arguments ReverseFind(abc, b) abc The character string, b the character to look for Example: ReverseFind(abcabc, b) returns 4 CurrentTime Returns the current date or time in a specified format. Syntax CurrentTime(%%Y-%%m-%%d %%H:%%M:%%S) Arguments %%a Abbreviated weekday name %%A Full weekday name %%b Abbreviated month name %%B Full month name %%c Date and time representation appropriate for locale %%d Day of month as decimal number (01 31) %%H Hour in 24-hour format (00 23) %%I Hour in 12-hour format (01 12) %%j Day of year as decimal number (001 366) %%m Month as decimal number (01 12) %%M Minute as decimal number (00 59) %%p Current locale's A.M./P.M. indicator for 12-hour clock %%S Second as decimal number (00 59) %%U Week of year as decimal number, with Sunday as first day of week (00 53) %%w Weekday as decimal number (0 6; Sunday is 0) %%W Week of year as decimal number, with Monday as first day of week (00 53) %%x Date representation for current locale %%X Time representation for current locale %%y Year without century, as decimal number (00 99) %%Y Year with century, as decimal number %%z, %%Z Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown %%%% Percent sign Example: CurrentTime(%%y%%m%%d) returns 050113

Page 29 of 30

CurrentTime(%%H:%%M) returns 09:53 Arithmetic Functions Add Returns the first (leftmost).specified number of characters from a specified string. Syntax Arguments Left(abc, 2) abc The character string, 2 Number of characters Example: Left(ProjectAA, 7) returns Project Right Returns the last (rightmost) specified number of characters from a specified string. Syntax Arguments Right(abc, 2) abc The character string, 2 Number of characters Example: Right(ProjectAA, 2) returns AA

File Variables The following pre-defined file variables are available. Note that they will return information about the current file that is processed in a For all documents block loop. The following file is used for the returned values listed below.

Option
Name of selected file Path to selected file Directory of selected file Current revision of selected file Current version of selected file Selected files current workflow state Name of user who created the file Time when selected file was created Time when selected file was modified Current configuration Path to roof folder Current folder path Name of current folder

Variable
%NameOfSelectedFile% %PathToSelectedFile% %DirOfSelectedFile% %CurrentRevisionOfFile% %CurrentVersionOfFile% %SelectedFileCurrentWorkflowState% %NameOfUserCreatedFile% %TimeFileCreated% %TimeFileModified% %CurrentConfig% %RootFolderPath% %CurrentFolderPath% %NameOfCurrentFolder%

Returns value
89-NOAO-4200-1234.sldprt C:\2008 x32 b54\FolderA\89-NOAO-42001234.sldprt C:\2008 x32 b54\FolderA A 4 Approved Admin 20070726 14:44:1 20070726 17:04:12 @ Note: Use a For all configurations loop. C:\2008 x32 b54 C:\2008 x32 b54\FolderA FolderA

Page 30 of 30

Name of current vault Name of logged in user

%NameOfCurrentVault% %NameOfLoggedInUser%

2008 x32 b54 Admin

You might also like