2025-02-18 06:27 AM - last edited 4 weeks ago
I am new to API writing, first attempt...
I am trying to change elevation marker names-but the following code the story height display inside the views as well.
the story markers displayed are not controlled by the story levels setting.
before running script :
after running script:
GSErrCode err = NoError;
API_Element element, elementMask;
GS::Array<API_Guid> elemList;
ACAPI_Element_GetElemList(API_ElevationID, &elemList);
size_t count = elemList.GetSize();
BNZeroMemory(&element, sizeof(API_ElevationID));
for (short e = 0; e < count; e++)
{
element.header.typeID = API_ElevationID;
element.header.guid = elemList[e];
err = ACAPI_Element_Get(&element);
if (err != NoError)
{
break;
}
GS::UniString name = element.elevation.segment.cutPlName;
if (name == "B") {
ACAPI_ELEMENT_MASK_CLEAR(elementMask);
ACAPI_ELEMENT_MASK_SET(elementMask, API_ElevationType, segment.cutPlName);
GS::ucscpy(element.elevation.segment.cutPlName, L("Z"));
if (element.header.guid != APINULLGuid) {
err = ACAPI_Element_ChangeParameters({ element.header.guid }, &element, nullptr, &elementMask);
if (err != NoError) {
ErrorBeep("ACAPI_Element_ChangeParameters", err);
}
}
ACAPI_ELEMENT_MASK_CLEAR(elementMask);
}
}
return;
I know there is something i am missing, i just don't know where to look next.
It is inconsistent as to when it happens.
It displays markers when the setting is set to no marker.
When i change to a marker, and close then open and change to no marker, then it display correctly.
Update...
These files were originally made in ArchiCAD 22 and then upgraded to ArchiCAD 25.
It appears that the upgrade hasn't set the .shAppearance value and the .shSymbolId value correctly for ArchiCAD 25 in the upgrade.
If i set the .shAppearance separately before changing other settings, then this problem doesn't happen.