We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-11-21 06:57 PM - last edited on 2024-09-16 02:57 PM by Doreena Deng
Hello Team,
We would like to bundle a set of gsm files with the Add-On. I got to know from my previous query in the community that it is possible. The documentation mentions about a Stair Marker Add-On which I could not find in the Examples folder. However, I am not yet clear on how to add a folder while building the bundle. (I am new to C++ as well). Any guidance on how to add a folder to the bundle would be really helpful.
I have been able to successfully load a folder into the library using the below snippet:
GSErrCode CreateLibrary (void)
{
IO::Location newLib("~/Work/library/types/gsm");
GSErrCode err;
err = ACAPI_Environment (APIEnv_AddLibrariesID, &newLib);
if (err == NoError){
std::cout << "New library has been loaded" << std::endl;
}
return err;
}
2023-11-23 08:51 PM
Hi Kency,
This is possible, but there are quite a lot of things to take care of. It took me a while to get this working.
Here are a few thoughts/tips:
Side Note: The stair-maker Add-On is not an available example project. It was shipped a few versions ago with Archicad I think.
Hope that helps,
Bernd
2023-11-27 01:06 PM
1. The 132 in the screenshot is from the documentation. How do we get the id before loading the library part?
2. Ok, will check out the APIAddon_Preload
3. Yes, I am using the CMake templates. I made changes in the CMakeList file to include .lcf file as shown in the screenshot
2023-11-30 08:32 AM
1. The resource id is a number you choose yourself and put into the resource file. So it could be 132 like in the example or any other positive number below 32767
(or something like this, can't find the source for this anymore. I think it was related to maximum repr. of 2^15 somehow which would be max value of short if it's 2 bytes). You can get the library id from your chosen resource id as described above.
3. The way I do it is by including the single .gsm files, not a complete .lcf container. I'm not sure if there's even a way to achieve it with a whole library container. Also as said above, you'll have to make sure that the files are included in the resource compilers output. I'd suggest studying the CompileResources.py script and checking it's output.