Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Hull and Outfitting

Defining an Add-in

  • Last UpdatedJan 09, 2024
  • 2 minute read

Each add-in is specified by an add-in definition file, with pathname %PDMSUI%\<module>\ADDINS\<addin>, where <module> is the module name for example, DES, and <addin> is the addin name for example, MYADDIN. This is similar in format to the entries in the old APPLICATIONS file. Each line contains a key and description, separated by a colon.

Some keys are available to all add-ins; others can be used only for applications, since they refer to menu text, gadgets and callbacks specific to that application.

Keys Available to all Add-ins

The following can be used by all add-ins.

Key

Description

Name

The unique identifier of the add-in, for example, GEN, DES. This key is compulsory.

Title

Text description of the add-in (if the add-in defines an application, the title appears in the title bar of the main window when the application is loaded)

ShowOnMenu

Determines whether the add-in has an entry on the Applications menu, that means, whether the add-in defines an application (false by default).

Object

Add-in object: user-defined object type used to help define the add-in, for example, APPGENERAL

ModuleStartup

Callback run when the Marine module first starts

StartupModify

Name of application to modify and the callback run when an application is first started, separated by a colon.

for example, EQUI:!!equiAppStartupCall().

SwitchModify

Name of application to modify and the callback to run when the application is switched to, separated by a colon.

for example, PIPE:!!pipeAppSwitchCall()

The following keys are only used for applications, that means, add-ins that have a menu option on the Applications menu and can be switched to.

Key

Description

Menu

Entry for application on the applications menu (the title is used if this isn’t specified)

Directory

Name of the application directory under %PDMSUI%\module

Synonym

Synonym created for the directory (only used if the directory is specified)

Group

Group number (applications with the same group number are put into a submenu together)

GroupName

Description of submenu to appear on main menu

Gadgets

Integer specifying the gadgets that appear on main form for this application:

1 - no gadgets

2 - sheet/library gadgets

3 - sheet/library and layer gadgets

4 - sheet/library and note/vnote gadgets

Type

Type of application for user applications. Valid values are DRA, DIM, LAB, USR1, USR2, USR3, USR4, USR5.

SwitchCall

Callback to be run every time the application is switched to.

StartupCall

Callback run when the application first starts.

To make it easier for user-defined add-ins to modify existing applications, it is possible for an add-in to add a startup or switch call to an application. You can do this by adding the lines of the following form to the add-in file.

startupModify: APPNAME: callback

switchModify: APPNAME: callback

where APPNAME is the name of the application to modify and callback is the callback to be assigned to it.

If an application with name APPNAME is not defined, the callback is not run.

TitleResults for “How to create a CRG?”Also Available in