SDK:The Definition of a Plug-in

From Vectorworks Developer
Jump to: navigation, search

.SDK|SDK ..SDK:Types|SDK Types ..SDK:Using the SDK|Using the SDK ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

The Definition of a Plug-in

Implementation of a plug-in can be broken into two parts:

  • writing the program source code that defines the plug-in
  • and creating the proper resources.

On the Macintosh platform, these components are combined into a single package that the user places into their "Plug-ins" folder.

On Windows, the code and resources exist in separate files, both of which are placed into the "Plug-ins" folder.

Some of the Macintosh resources described below are custom resources defined by Vectorworks specifically for the VectorWorks SDK. Refer to SDK:Plug-in Resources for more information on editing these custom resource types.

A Windows Plug-in may also contain Windows Resources.

The following resources will be found in a completed plug-in:

Definition Resource

Each type of plug-in has a resource type that defines certain standard behavior for the plug-in.

  • For a menu command the resource type is MITM.
  • For a tool the type is TDef.
  • For an object it is PDEf.
  • For a library routine it is VLIB.

Every plug-in must have a valid definition resource with an ID of 128. These are custom resources defined by Vectorworks, and are described in more detail later in this section.

Auxiliary Resources

Recommended resources for most plug-ins.

  • TEXT
This resource holds the text for the help tag (tool tip) and must have a resource ID of 128. The length of this resource must be less than 239 characters. Help tags are managed by VectorWorks automatically when you provide this resource. If you add or edit this resource in the plug-in you will need to edit all Workspaces containing that plug-in to force the new help to appear.
  • vers
All plug-ins must have vers resources of ID 1 and optionally of ID 2. ‘vers’ 1 is the plug-in’s version.
‘vers’ 2 is the version of the package that the plug-in was shipped with. Vectorworks plug-ins use ‘vers’ 2 to specify which version of VectorWorks the plug-in shipped with.
If your plugin exists independently then it does not need a ‘vers’ 2 resource.

Private Resources

Plug-ins may also use any other resources for their own purposes. These standard resources are defined in the “Inside Macintosh” series of books, the “ResEdit Reference” and Apple’s website: So as not to conflict with resources in VectorWorks, resource ID for private resources should be in the following ranges:

Resource Types: Resource ID range for plug-ins:
PICT, ICON, ICN#, DLOG, DITL, STR#, 11000 to 14999
CURS Greater than or equal to 17000
Hierarchical MENU 128-191
MENU Greater than 11000
All other resources Greater than 10000

See Also

The Plug-in and the User | The Definition of a Plug-in | Tool or Menu Command | Communication Between VectorWorks and Plug-ins | Global Data

Personal tools

Advanced Search
See Also