Archicad 28 C++ API
|
All add-ons must have a resource named MDID
with a resource ID of 32500. This resource defines the unique ID of the add-on.
The ID is composed from two parts:
It is primary used by the Communication Manager and the ModulData Manager to identify the target add-on. Starting with DevKit v4.1, the module ID is used in many areas of add-on identification (though it is not always visible), from storing preferences to assigning custom data to elements.
In order to avoid collisions Archicad will refuse to load those add-ons, whose MDID
resources are identical.
Add-on (module) identifier resource.
'MDID' 32500 "Add-On Identifier" { _developerID_ _localID_ }
developerID
A four-byte identifier of the 3rd party developer. Developers can get their ID upon registration at archicadapi.graphisoft.com.
localID
A four byte identifier of the add-on. The ID must be generated by the developer at archicadapi.graphisoft.com site inside the AddOns profile.
Please refer to the Registration paper to have further details how to get your registration ID.
This resource is required and used as a unique ID of the add-on.
The ID is composed of two parts. The developerID
is generated by Graphisoft upon registration. It is ensured to be unique to each Registered 3rd Party Developer. The developer is responsible to generate a unique localID
for each of his/her add-on.
Refer to the Registration paper to get further details.
Note, that Archicad refuses to load those add-ons whose MDID
resources are the same.
This resource is not required (in the term that Archicad interprets your DLL/Code fragment as a valid Archicad add-on) but strictly necessary in most cases. Archicad uses these string resources to build up the menus, or popup items related to your commands. A special resource should also contain some information about your add-on (a short description and a name which appear in the Add-On Manager dialog); see the example projects.
You can find more example STR#
resources at the description of ACAPI_MenuItem_RegisterMenu.
'STR#' 32500 "Menu strings" { /* [ 1] */ "Database Tracker" /* [ 2] */ "Enable red walls^32601" /* [ 3] */ "-" /* [ 4] */ "Enable column links" /* [ 5] */ "List links (selection)^S" /* [ 6] */ "List links (database)" /* [ 7] */ "-" /* [ 8] */ "List walls with assignments" }
You can see that the name of the first command ends with the string "^32601". This extension instructs Archicad to assign a custom picture to the given menu item. The picture itself must be an icon resource ('GICN
') with the resource ID following the ^ character. Of course the extension string will not appear in the appropriate menu.
From Archicad 8 this menu item icon appears in the menu by default. If you do not want this icon to be shown in the menu, insert a ~ (tilde) character before the icon ID number, like this "^~32601".
Other control codes can be appended after the menu item strings to control the availability of the command. The following values are possible:
Control code | Meaning |
---|---|
^D2 | The command is disabled above the floor plan window |
^E3 | The command is enabled above the 3D window |
^ES | The command is enabled above section type windows |
^EE | The command is enabled above elevation type windows |
^EI | The command is enabled above interior elevation type windows |
^ED | The command is enabled above detail drawing windows |
^EL | The command is enabled above layout and master layout windows |
^EW | The command is enabled above worksheet windows |
^ET | The command is enabled above 3D document windows |
^EM | The command is enabled above Model Compare windows |
^G | The menu item is disabled (grayed) by default |
^M | The menu item is checked (has a check mark) by default |
^R | The command is repeatable, that is after calling the menu command it will be available from the "Repeat Last Command" item of the Edit menu as well. This capability can be useful, if an add-on command should be called several times again and again. |
^S | The command is available only when there are selected elements in the current window |
^T | The command is disabled in TeamWork mode if the current window (story, section, detail, layout) does not belong to the client's workspace |
The file import/export type add-on requires a string which describes your file format, and appears in the lists of the import/export dialogs.
'STR#' 32501 "File type popup string" { /* [ 1] */ "My file format" }
For more details see the description of the ACAPI_AddOnIntegration_RegisterFileType function.
Every file dialog of Archicad contain an item which shows an icon assigned to the selected file format. You can assign a custom icon to your file format by including an ICN#
resource also. This feature is implemented on Macintosh only.
Of course you can add more STR#
string resources with different resource IDs. These strings can be loaded with the ACAPI_Resource_GetLocStr or the ACAPI_Resource_GetLocUStr function.
The Graphisoft Dialog Manager (DG) are also using some custom resource types. Their reference papers can be found in Dialog Manager documentation.