隱藏目錄

Creating Variables for Dispatch Scripts

Use the Set variables dialog to define Enterprise PDM Dispatch variables that evaluate when a Dispatch action runs.

You can create variables for use in your Dispatch scripts and in graphical elements you create for your scripts:

  1. Access the Set variables dialog by clicking Variables in the Edit Action dialog or by clicking right arrow in Dispatch dialogs.
  2. Click Add to create a new variable.
  3. From the Name field, select the newly added variable and type a name.
  4. From the Type drop-down field, select a data type:

    Option

    Description

    Current configuration

    %CurrentConfig%

    Example: @

    Current folder path

    %CurrentFolderPath%

    Example: C:\VaultProjA\FolderA

    Current revision of selected file(s)

    %CurrentRevisionOfFile%

    Example: A

    Current version of selected file(s)

    %CurrentVersionOfFile%

    Example: 4

    Directory of selected file(s)

    %DirOfSelectedFile%

    Example: C:\VaultProjA\FolderA

    Name of current folder

    %NameOfCurrentFolder%

    Example: FolderA

    Name of current vault

    %NameOfCurrentVault%

    Example: VaultProjA

    Name of logged-in user

    %NameOfLoggedInUser%

    Example: Admin

    Name of selected file(s)

    %NameOfSelectedFile%

    Example: 89-NOAO-4200-1234.sldprt

    Name of user who created selected file(s)

    %NameOfUserCreatedFile%

    Example: Admin

    Path to selected file(s)

    %PathToSelectedFile%

    Example: C:\VaultProjA\FolderA\89-NOAO-4200-1234.sldprt

    Path to SOLIDWORKS Enterprise PDM root folder

    %RootFolderPath%

    Example: C:\VaultProjA

    Runtime variable

    A runtime variable is a temporary container to store user input. You can then use the runtime variable in your action scripts.

    Example: UserState

    Selected file(s) current workflow state

    %SelectedFileCurrentWorkflowState%

    Example: Approved

    Static string

    Sets the variable to a static string you create using the Value field.

    Example: %Number%_%Rev%.pdf

    Time when selected file(s) was created

    %TimeFileCreated%

    Example: 20090726 14:44:1

    Time when selected file(s) was modified

    %TimeFileModified%

    Example: 20090726 17:04:12

    Value of environmental variable

    Sets the variable to the value of an environmental variable you choose.

    Example: USERNAME

    Value of registry variable

    Sets the variable to the value of a registry variable you choose.

    Example: FileExtVer

    Variable value from selected file(s) datacard

    Sets the variable to the value of a datacard variable you choose.

    Example: Approved on

  5. Complete the conditional fields that display based on the selected Type:
    1. If Type is Static string - In the Value field, enter a value or click right arrow to build the value from predefined variables, string functions, or arithmetic functions.
    2. If Type is Value of environmental variable - In the Environmental variable field, type or click right arrow to select an environmental variable.
    3. If Type is Value of registry variable - In the Registry variable field, type a registry variable name.
    4. If Type is Variable value from selected file(s) datacard - In the Data card variable field, type or click right arrow to select a data card variable. Next, in the Configuration field, type the configuration.
  6. Continue to add variables (by clicking Add) or delete variables (by selecting a variable and clicking Remove).
  7. Click OK to save the variables.


提供對此主題的意見反應

SOLIDWORKS 歡迎您提供有關於文件呈現方式、正確性、及完整性的意見反應。請使用下方的表格直接將您對此主題的意見與建議傳送給我們的文件團隊。文件團隊並無法回答關於技術支援的問題。按一下此處來獲得關於技術支援的資訊

* 必要的

 
*電子郵件:  
主旨:   說明主題的意見反應
頁面:   Creating Variables for Dispatch Scripts
*意見:  
*   我承認已閱讀且僅此接受隱私權政策,Dassault Systèmes 將遵循此政策之規定使用我的個人資料

列印主題

選擇要列印的內容範圍:

x

偵測到您使用的瀏覽器版本是舊於 Internet Explorer 7。要獲得最佳的顯示,建議您升級瀏覽器到 Internet Explorer 7 或更新的版本。

 不要再次顯示此訊息
x

Web 式說明內容版本:SOLIDWORKS PDM 2014 SP05

要從 SOLIDWORKS 中停用 Web 式的說明並改用本機說明,請按一下說明 > 使用 SOLIDWORKS Web 式說明

要報告在 Web 式說明介面及搜尋中遇到的問題,請聯絡您當地的技術支援代表。要針對個別說明主題提供意見反應,請使用個別主題頁面中的「提供對此主題的意見反應」連結。