cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The 2025 Technology Preview Program is now live. Join today!

Archicad C++ API
About Archicad add-on development using the C++ API.

Changing Elevation name - unwanted changes to story lines - C++ AC25

AllanP
Expert

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 :

AllanP_0-1738890873756.png

AllanP_2-1739159747329.png

 

 

after running script:

AllanP_0-1739159647337.png

AllanP_1-1739159680456.png

 

 

 

	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.

 

I have been using ArchiCAD continually since ArchiCAD 4.5
Member of Architalk since 2003, but missed the migration to Graphisoft. Melbourne, Australia
0 REPLIES 0

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!