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

Addon to change all views renovation filter to current renovation filter

Jay Chung
Newcomer
Hi All,

I'm very new to coding and want to create a very simple addon to change all view renovation filter ID to current renovation filter ID.

I'm trying to follow the documention provided but am finding it quite dense!

https://archicadapi.graphisoft.com/documentation/apinavigator_changenavigatorviewid

If someone could have a look and give my any pointers that would be great.
API_NavigatorItem navItem;

BNZeroMemory(&navItem, sizeof(API_NavigatorItem));

navItem.mapId = API_PublicViewMap;    //for performance

if (ACAPI_Navigator(APINavigator_GetNavigatorItemID, guid, &navItem) == NoError)
{
	API_NavigatorView navView;
	BNZeroMemory(&navView, sizeof(API_NavigatorView));
	if (ACAPI_Navigator(APINavigator_GetNavigatorViewID, &navItem, &navView) == NoError) {
		if (navView.layerStats != nullptr)
			BMhKill((GSHandle*) &(navView.layerStats));
		if (navView.modelViewOpt != nullptr)
			BMKillPtr((GSPtr*) &(navView.modelViewOpt));
		if (navView.dimPrefs != nullptr)
			BMKillPtr((GSPtr*) &(navView.dimPrefs));

		err = ACAPI_Attribute_GetNum(API_RenovationFilterID, &attributeCount);
		if (err == NoError) {
			BNZeroMemory(&attribute, sizeof(API_Attribute));
			attribute.header.typeID = API_RenovationFilterID;
			for (i = attributeCount; i > 0; --i) {
				attribute.header.index = i;
				err = ACAPI_Attribute_Get(&attribute);
				if (err == NoError) {
					CHTruncate(attribute.header.name, navView.renovationFilterGuid, sizeof(navView.renovationFilterGuid));
					break;
				}
			}
		}
0 REPLIES 0

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!