2 weeks ago
- last edited
a week ago
by
Laszlo Nagy
I would like to retrieve the stair tread depth using the Archicad API. I tried accessing stair.treadDepth from API_Element, but the returned value is always 1.
May I ask what might be causing this issue? Or is the tread depth not supposed to be obtained from this field?
Below are a test screenshot and the source code used for retrieving the stair tread depth.
API_Neig neig;
API_ElemType elemtype = API_StairID;
if (ClickAnElem("click a stair", API_StairID, &neig)) {
API_Element elem;
elem.header.guid = neig.guid;
GSErrCode err = ACAPI_Element_Get(&elem);
if (err == NoError) {
GS::UniString msg = "treadDepth = ";
msg += GS::ValueToUniString(elem.stair.treadDepth);
ACAPI_WriteReport(msg, true);
};
}
a week ago
Hi Jin,
I've tried your code and get the same result: For stairs with fixed goings, the treadDepth is always "1.0".
Maybe the actual tread depth needs to be calculated from other values or retrieved from every single tread via the element memo.
I've tried changing the 'treadDepth' to '2.0' and use 'ACAPI_Element_Change', but nothing happens (also no error).
Best regards,
Bernd
Monday
Thank you for your reply, Bernd.
Retrieving from element memo seems to be a good way to try. Thank you for your advise!