Task Properties - Script (For SOLIDWORKS PDM Professional only)

Use the Scripts page of a task's Properties dialog box to modify the Task Add-in script. You select the SOLIDWORKS version and task type. Use this Scripts page when you create new tasks that use the SOLIDWORKS Task Add-in or modify a Design Checker task.

To display this page, do one of the following:

  • Right-click Tasks and click New Task.
  • Expand Tasks and double-click Design Checker.

On the Add-in page, for Add-in, select SOLIDWORKS Task Add-in. In the left pane, click Script.

Enter script to execute in SOLIDWORKS Script of plug-in that executes task.

To modify the script:

  • Type in the box.
  • Place the pointer in text box and click Insert Macro.
Insert Macro Inserts a macro at the cursor location in the script.

See Inserting Macros in SOLIDWORKS Task Add-in Scripts (For SOLIDWORKS PDM Professional only).

The following macros resolve to values in the user interface:

Source Folder Path

Inserted in script: <Path>

Resolves to: Folder where the source file is located.

Example: C:\MyVault\Drawings\.

Vault Root Folder Path

Inserted in script: <VaultPath>

Resolves to: Root folder of the vault.

Example: C:\MyVault\.

Task Instance GUID

Inserted in script: <TaskInstanceGuid>

Resolves to: A globally unique identifier (GUID) that is used as the task ID.

Source File Path

Inserted in script: <Filepath>

Resolves to: The full path and file name of the source file.

Example: C:\MyVault\Drawings\Part.sldprt.


The following macros do not resolve to actual values. They remain as tokens in the script. You must add code that parses the values from the resolved value of other macros such as <Filepath>. Examples of how to do this are found in the default scripts for the Print and Convert tasks.

Source File Name

Inserted in script: <Filename>

Source File Extension

Inserted in script: <Extension>

Configuration Name

Inserted in script: <Configuration>

SOLIDWORKS version to use SOLIDWORKS version used by task.

All tasks you create using the SOLIDWORKS Task Add-in must be run on a computer that has this version of SOLIDWORKS installed.

Task user interface type Determines configurable options for task.
You must save and then edit the task to see the configurable options, which are available as pages in the task's Properties dialog box.
Select one:
User Interface Type Configurable Options
  • Add-in
  • Execution Method
  • Menu Command
  • Script
  • Permissions
  • Success Notification
  • Error Notification
File Conversion General options plus:
  • Conversion Settings
  • File Card
  • Output File Details
Printing General Options plus:
  • Printer
  • Paper Size and Orientation
  • Margins
  • Files