2025-09-30 11:15 AM
Hi,
I'm struggling with moving the vertices of a railing. Here's a minimal example of the code I'm using:
err = ACAPI_CallUndoableCommand ("Move Railing Test", [](){
GS::Array<API_Guid> railingList{};
GSErrCode err = ACAPI_Element_GetElemList (API_RailingID, &railingList,
APIFilt_IsEditable | APIFilt_InMyWorkspace | APIFilt_OnActFloor
);
if (err != NoError) { return err; }
for (auto elemGuid : railingList) {
API_Element elem{};
elem.header.guid = elemGuid;
err = ACAPI_Element_Get (&elem, 0);
if (err != NoError) { return err; }
API_ElementMemo memo{};
GS::UInt64 memoMask = APIMemoMask_Polygon;
err = ACAPI_Element_GetMemo (elemGuid, &memo, memoMask);
if (err != NoError) { return err; }
for (GS::UInt32 i = 1; i <= elem.railing.nVertices; ++i) {
(*memo.coords)[i].x += 1.0;
}
err = ACAPI_Element_ChangeMemo (elemGuid, memoMask, &memo);
if (err != NoError) { return err; }
}
return err;
});
If you draw a railing and the try to execute the command, I want it to move all vertices 1m to the right.
The `ACAPI_Element_ChangeMemo` command doesn't return any errors but also the railing doesn't change it's position. I've also tried `ACAPI_Element_Change` without success.
The example projects don't seem to contain any similar code either. The other railing elements (nodes etc.) don't seem to contain coordinates, so I'm not sure what I'm missing.
Any ideas?
Thanks!
Bernd
Solved! Go to Solution.
2025-10-17 04:25 PM
Hi Bernd,
Unfortunately due to a known bug in the API this is not possible. I'll try to raise its priority...
Best, Akos
2025-10-03 08:45 AM
Hi Bernd,
Have you tried ACAPI_Element_Edit()?
Best, Akos
2025-10-07 09:18 AM
Hi Akos,
I haven't tried it, because for my actual problem I want to move the vertices in different directions. Everything +1m to the right was just to simplify the code here.
I'll try it though! Maybe I also have to move the railing nodes etc. with the edit command.
Thanks so much for the hint! I'll report back once I'm home from GSIgnite and have time to try it. Hope to see you in Budapest 🙂
Bernd
2025-10-16 04:36 PM
Hi Akos,
Moving the whole railing with ACAPI_Element_Edit works. But I wasn't able to figure out how to move single vertices of the railing.
I've tried a lot of different scenarios with ACAPI_Element_Edit & ACAPI_Element_ChangeMemo.
Passing single railing nodes to the Edit function didn't work, neither does changing the poly coords with change memo.
Any hints or ideas what else I could try or what's the intended way is?
Unfortunately the examples also don't have anything for editing single vertices of railings.
Best,
Bernd
I want to move single vertices of the reference line, I wasn'tNone of it worked so far
2025-10-17 04:25 PM
Hi Bernd,
Unfortunately due to a known bug in the API this is not possible. I'll try to raise its priority...
Best, Akos
2025-10-21 10:28 AM
Thanks Akos for looking into this and raising the priority!
How does it typically work if there comes a bug fix like this. Is it typically only in the newest DevKit or are they also incorporated in older DevKits?
Best,
Bernd
3 weeks ago
Hi Bernd,
A similar bug has been fixed in Archicad 28; which version do you use?
Bugfixes are part of Archicad Updates or Hotfixes, and are ported back to previous versions only in very rare cases.
Best, Akos
3 weeks ago
Akos,
Thanks for the hint! If I remember correctly I've tried it with both AC26.7004 & DevKit 26.7000 and AC29.3000 & DevKit 29.3000.
I'll give it a try with newest AC28 & AC29 again and report back.
Best,
Bernd
2 weeks ago
Akos,
I've tried it with more versions now and unfortunately it doesn't work with any of them.
This is a list of versions I've tried (all of them INT language versions)
A fix for AC29 would be great 🙂 I think AC28 would be not strictly necessary for us, but could help in case AC29 can't be used.
Thanks a lot for your help and all the information!
Best,
Bernd