cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.

How to get Addon folder file name?

Anonymous
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;
    location.ToPath(&path);
    const char * pCharPath = path.operator const char*();
    ACAPI_WriteReport(pCharPath, true);
}
API_SpecFolderID:

API_ApplicationPrefsFolderID
    The folder into which the application writes its preferences.
API_GraphisoftPrefsFolderID
    The folder containing general preferences of Graphisoft applications.
API_GraphisoftHomeFolder
    The Graphisoft home folder.
API_CacheFolder
    The folder where the application may write data to speed up its operation.
API_UserDocumentsFolder
    The folder where the application places the output files by default.
API_TemporaryFolder
    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.
1 REPLY 1
Anonymous
Not applicable
I found the solution:

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

}