a month ago
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
Wednesday
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.