2026-07-21 12:19 PM
bOverridePostSurface / matPost) on Railing sub-elements — Posts, Rails, Panels, etc. — identified by their own GUID (obtained via ACAPI_Element_GetMemo_ExternalHierarchical / the equivalent subelement enumeration).ACAPI_Element_GetMemo(subElemGuid, &memo, APIMemoMask_AddPars) correctly returns the full AddPar list for a sub-element (e.g. 111 parameters for a Post, including bOverridePostSurface/matPost).ACAPI_LibraryPart_OpenParameters (session-based) on the sub-element — fails outright; can't get a session open for this element type.ACAPI_Element_Change(&element, &mask, &memo, APIMemoMask_AddPars, true) directly on the sub-element's own guid — APIERR_BADPARS. (Tried both an empty mask and ACAPI_ELEMENT_MASK_SETFULL.)ACAPI_Element_ChangeParameters(elemGuids, &element, &memo, &mask) — APIERR_BADID.ACAPI_Element_ChangeExt using API_SubElement with subType = APISubElement_RailingPost, called on the owning top-level Railing element — APIERR_BADID, tried both with the sub-element's real GUID set and with the fully-populated API_Element copied into subElem, indices left at subIndex = subSubIndex = 0. Same rejection both times.API_SubElementType defines APISubElement_RailingPost, RailingRail, etc., and API_SubElement::subIndex/subSubIndex's field docs specifically mention Railing — but API_SubElement's own class-level description only lists Window/Door/Section/Elevation/InteriorElevation/ChangeMarker/CurtainWall as the element types supported by ACAPI_Element_GetDefaultsExt/ChangeDefaultsExt/CreateExt/ChangeExt. Railing isn't mentioned there, which would explain the consistent APIERR_BADID.API_RailingPostType/API_RailingNodeType/API_RailingSegmentType/etc. carry a params/AddPar handle anywhere in the struct tree, so there's nothing to modify even via the parent Railing's own memo.ACAPI_Element_ChangeExt is meant to support it, what are the correct semantics for subIndex/subSubIndex for APISubElement_RailingPost specifically (segment index? node index? position within a pattern?), and does subElem's GUID matter at all, or is addressing purely index-based?
Operating system used: Windows
3 weeks ago
Hi Mathias,
I've opened a support issue about your question.
Regards,
Tamás
a week ago
- last edited
Friday
by
Laszlo Nagy
Hi Mathias,
I've got an answer from the developer, please find it below.
Regards,
Tamás
Does this workflow work, or? If not, which point fails?
Obtain the editable Post/Rail/Panel sub-element GUID from the owner railing memo.
Call ACAPI_Element_Get using that sub-element GUID.
Call ACAPI_Element_GetMemo(guid, &memo, APIMemoMask_AddPars).
Modify memo.params
bOverridePostSurface: Boolean stored in value.real
matPost: Material stored in value.real
Call
ACAPI_Element_Change (
&element,
nullptr,
&memo,
APIMemoMask_AddPars,
true
);Check the result and dispose the memo.
yesterday
ACAPI_Element_Get on that GUID — succeeds (returns a valid API_Element with header.typeID == API_RailingPostID).ACAPI_Element_GetMemo(guid, &memo, APIMemoMask_AddPars) — succeeds, returns all 111 AddPars including bOverridePostSurface and matPost.memo.params in place (setting bOverridePostSurface and matPost via their value.real/boolean fields) — no issue, values are correctly written into the handle before the change call.ACAPI_Element_Change(&element, nullptr, &memo, APIMemoMask_AddPars, true);
nullptr, an empty (ACAPI_ELEMENT_MASK_CLEAR) mask, and a fully-set (ACAPI_ELEMENT_MASK_SETFULL) mask, all three give the identical APIERR_BADPARS. This is the exact same error I got in my original attempt before asking on the forum, so this suggested workflow doesn't change the outcome for me on Archicad 29.ACAPI_Element_Change with a memo/memoMask genuinely expected to work directly on a Railing sub-element's own GUID (bypassing the owning Railing entirely), or does writing AddPars for Railing sub-elements actually require going through the owner via ACAPI_Element_ChangeExt/API_SubElement after all — and if so, what are the correct subIndex/subSubIndex semantics for APISubElement_RailingPost specifically? That path also returned APIERR_BADID in my testing, so if the fix requires it, some detail is still missing on my end (guid vs index addressing, subElem contents, etc.).