Archicad C++ API
About Archicad add-on development using the C++ API.

How to get Addon folder file name?

Not applicable
How to get Addon folder file name? I want to open a help file (html) which is located in the same place with the addon. Opening the file in to browser can be done with:

ShellExecute(NULL, "open", pPath, NULL, NULL, SW_SHOWNORMAL);

ACAPI_Environment(APIEnv_GetSpecFolderID,,..) I can get some folder names but there is no FolderID for Addons.

Example code to show the application folder:

IO::Location location;
API_SpecFolderID  specFolderID = API_ApplicationFolderID;
GSErrCode errCode = ACAPI_Environment (APIEnv_GetSpecFolderID, &specFolderID, &location, NULL);
if(errCode == NoError) {
    IO::Path path;
    const char * pCharPath = path.operator const char*();
    ACAPI_WriteReport(pCharPath, true);

    The folder into which the application writes its preferences.
    The folder containing general preferences of Graphisoft applications.
    The Graphisoft home folder.
    The folder where the application may write data to speed up its operation.
    The folder where the application places the output files by default.
    The folder where the application stores temporary data, and which will be emptied when you launch the application.
API_ApplicationFolderID 4.2
    The folder containing the running application. It should be considered as read-only.
API_DefaultsFolderID 6.1
    This folder contains the default preferences (e.g. default user profile settings, shortcuts, command layouts, etc.) that come with the program installation. Located in the application folder, and should be considered as read-only.
API_WebObjectsFolderID 6.1
    This folder is the recommended place for storing objects and other files downloaded from the Web.
API_TemplatesFolderID 6.1
    The default location of ArchiCAD project templates.
API_HelpFolderID 10
    The default location of the application's Help folder.

Not applicable
I found the solution:

IO::Location location;
GSErrCode errCode = ACAPI_GetOwnLocation (&location);
if(errCode == NoError) {


Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!