2 weeks ago
I'm porting an AC9 add-on to AC28 (DevKit 28.4001).
When my add-on calls ACAPI_LibraryPart_OpenParameters on one specific
GSM, it returns APIERR_GENERAL (-2130313215 / 0x81060001). The library
part loads correctly and places fine manually via the Object Tool, but
my C++ code cannot open a parameter session on it.
Failing GSM: "Slab Extras New.gsm" (48 parameters, AC9-migrated,
GDL scripts contain glob_user_2/17/18 reads and request("Story"/
"Home_story") calls in the Master script).
Working GSMs in the same library ( all use the same OpenParameters workflow
successfully.
Code — standard call per LibPart_Test.cpp example:
API_ParamOwnerType owner;
BNZeroMemory(&owner, sizeof(API_ParamOwnerType));
owner.libInd = libPart.index; // valid index, positive
GSErrCode err = ACAPI_LibraryPart_OpenParameters(&owner);
// err == -2130313215
The SDK header comment for ACAPI_LibraryPart_OpenParameters says
APIERR_GENERAL means "the library part do not has parameters" — but
this part does have 48 parameters (LibPart_GetParams succeeds), so
that description doesn't match my case.
What I've tried:
- Stripped null-GUID <CalledMacros> entries from the GSM → still fails
- Initialised uninitialised variables the GDL editor flagged → still fails
- Removed AC9-era glob_modpar_name guards → still fails
- Guarded glob_user_* reads with value checks → still fails
- Compared byte-by-byte structure with working GSMs — the failing one
has 3 unguarded parameter mutation blocks and 2 unguarded
request("Story"/"Home_story") calls in Master, but working GSMs
wrap those in `if not(GLOB_CONTEXT = 3 or GLOB_CONTEXT = 4) then`
(I've tried both with and without the guard).
Question:
What specific GDL construct causes AC28's parameter engine to refuse
OpenParameters for an otherwise-valid GSM? The exact rule isn't
documented in the SDK, the GDL Reference Guide, or the GDL Style
Guide. Which construct specifically triggers APIERR_GENERAL from
the parameter session opener?
I've attached the failing GSM and the XML decompile for reproduction.
Add-on version: Archicad 28, DevKit build 4001.
Operating system used: Windows 11
Solved! Go to Solution.
Tuesday
Hi Steve,
Sorry about the delay.
The reason for the APIERR_GENERAL return value is because there is a division by zero error running the Parameter script when you ask for the parameters.
The division by zero comes from the Master script which is executed before the Parameter script.
I don't know if running the 2D script the same error would occur, because the object is missing necessary macros.
Regards,
Tamás
a week ago
Hi,
I'm going to debug it, and get back to you.
Regards,
Tamás
a week ago
Thanks
Monday
did you get any chance to look at it ?
Tuesday
Hi Steve,
Sorry about the delay.
The reason for the APIERR_GENERAL return value is because there is a division by zero error running the Parameter script when you ask for the parameters.
The division by zero comes from the Master script which is executed before the Parameter script.
I don't know if running the 2D script the same error would occur, because the object is missing necessary macros.
Regards,
Tamás
Wednesday
Thanks