Programming Tasks
In
SOLIDWORKS PDM Professional 2009 and earlier, add-ins work only on single client machines:
- A change-state hook calls the add-in on the machine where the change state command
is executed.
- or -
- A menu
command executes the add-in on the computer where the menu command is selected.
Although this is often desirable, there are times when you want to execute the add-in on different machines. SOLIDWORKS PDM
Professional 2010 and later allow you to program tasks to execute add-ins on other
machines.
A task consists of:
- Add-in to execute.
- Card, if any, to show when the task is launched.
- User credentials to use to execute the add-in.
- Computers on which to execute the add-in.
-
Optional scheduling of the add-in.
- Credentials of users who have permission to run the add-in.
- Error and success notifications.
You can read more about
the task execution system in the SOLIDWORKS PDM Professional Help.
To program your own task:
- Write an add-in DLL that supports
task execution.
- Add the add-in
to the vault using the Administration tool.
- Enable execution of the add-in on one or more servers by
selecting the Task Host Configuration command from the context-sensitive menu on the SOLIDWORKS PDM Professional icon in the task bar navigation area
(system tray).
- Right-click the tasks node in the Administration tool and select
New Task from the menu.
- Select your add-in
in the task wizard.
- Select other options in the task wizard.
The task is executed in one of the following ways:
- A task definition spawns task instances
according to a defined schedule.
- A workflow change
state action executes the task.
- Start the Administration tool, expland Tasks,
double-click Task List, and click Add Task.
- Right-click a file vault view and select the task on the
context-sensitive menu.
Using the Standard Task Add-in
You do not need to program your own task add-in if you only need to open files in SOLIDWORKS and execute scripts on them. To do
that, use the standard task add-in
that is shipped with SOLIDWORKS PDM Professional.
Code
Samples
Interfaces
Structures and Constants