<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Addon to change all views renovation filter to current renovation filter in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Addon-to-change-all-views-renovation-filter-to-current/m-p/218937#M2221</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I'm trying to follow the documention provided but am finding it quite dense!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://archicadapi.graphisoft.com/documentation/apinavigator_changenavigatorviewid" target="_blank" rel="noopener"&gt;https://archicadapi.graphisoft.com/documentation/apinavigator_changenavigatorviewid&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If someone could have a look and give my any pointers that would be great.&lt;BR /&gt;
&lt;PRE&gt;API_NavigatorItem navItem;

BNZeroMemory(&amp;amp;navItem, sizeof(API_NavigatorItem));

navItem.mapId = API_PublicViewMap;    //for performance

if (ACAPI_Navigator(APINavigator_GetNavigatorItemID, guid, &amp;amp;navItem) == NoError)
{
	API_NavigatorView navView;
	BNZeroMemory(&amp;amp;navView, sizeof(API_NavigatorView));
	if (ACAPI_Navigator(APINavigator_GetNavigatorViewID, &amp;amp;navItem, &amp;amp;navView) == NoError) {
		if (navView.layerStats != nullptr)
			BMhKill((GSHandle*) &amp;amp;(navView.layerStats));
		if (navView.modelViewOpt != nullptr)
			BMKillPtr((GSPtr*) &amp;amp;(navView.modelViewOpt));
		if (navView.dimPrefs != nullptr)
			BMKillPtr((GSPtr*) &amp;amp;(navView.dimPrefs));

		err = ACAPI_Attribute_GetNum(API_RenovationFilterID, &amp;amp;attributeCount);
		if (err == NoError) {
			BNZeroMemory(&amp;amp;attribute, sizeof(API_Attribute));
			attribute.header.typeID = API_RenovationFilterID;
			for (i = attributeCount; i &amp;gt; 0; --i) {
				attribute.header.index = i;
				err = ACAPI_Attribute_Get(&amp;amp;attribute);
				if (err == NoError) {
					CHTruncate(attribute.header.name, navView.renovationFilterGuid, sizeof(navView.renovationFilterGuid));
					break;
				}
			}
		}&lt;/PRE&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Sep 2021 07:23:56 GMT</pubDate>
    <dc:creator>Jay Chung</dc:creator>
    <dc:date>2021-09-14T07:23:56Z</dc:date>
    <item>
      <title>Addon to change all views renovation filter to current renovation filter</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Addon-to-change-all-views-renovation-filter-to-current/m-p/218937#M2221</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I'm trying to follow the documention provided but am finding it quite dense!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://archicadapi.graphisoft.com/documentation/apinavigator_changenavigatorviewid" target="_blank" rel="noopener"&gt;https://archicadapi.graphisoft.com/documentation/apinavigator_changenavigatorviewid&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If someone could have a look and give my any pointers that would be great.&lt;BR /&gt;
&lt;PRE&gt;API_NavigatorItem navItem;

BNZeroMemory(&amp;amp;navItem, sizeof(API_NavigatorItem));

navItem.mapId = API_PublicViewMap;    //for performance

if (ACAPI_Navigator(APINavigator_GetNavigatorItemID, guid, &amp;amp;navItem) == NoError)
{
	API_NavigatorView navView;
	BNZeroMemory(&amp;amp;navView, sizeof(API_NavigatorView));
	if (ACAPI_Navigator(APINavigator_GetNavigatorViewID, &amp;amp;navItem, &amp;amp;navView) == NoError) {
		if (navView.layerStats != nullptr)
			BMhKill((GSHandle*) &amp;amp;(navView.layerStats));
		if (navView.modelViewOpt != nullptr)
			BMKillPtr((GSPtr*) &amp;amp;(navView.modelViewOpt));
		if (navView.dimPrefs != nullptr)
			BMKillPtr((GSPtr*) &amp;amp;(navView.dimPrefs));

		err = ACAPI_Attribute_GetNum(API_RenovationFilterID, &amp;amp;attributeCount);
		if (err == NoError) {
			BNZeroMemory(&amp;amp;attribute, sizeof(API_Attribute));
			attribute.header.typeID = API_RenovationFilterID;
			for (i = attributeCount; i &amp;gt; 0; --i) {
				attribute.header.index = i;
				err = ACAPI_Attribute_Get(&amp;amp;attribute);
				if (err == NoError) {
					CHTruncate(attribute.header.name, navView.renovationFilterGuid, sizeof(navView.renovationFilterGuid));
					break;
				}
			}
		}&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:23:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Addon-to-change-all-views-renovation-filter-to-current/m-p/218937#M2221</guid>
      <dc:creator>Jay Chung</dc:creator>
      <dc:date>2021-09-14T07:23:56Z</dc:date>
    </item>
  </channel>
</rss>

