<?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 Re: Adding new navigator item [SOLVED TEMPORARILY] in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Adding-new-navigator-item-SOLVED-TEMPORARILY/m-p/211461#M5816</link>
    <description>Hi, &lt;BR /&gt;
 &lt;BR /&gt;
Thanks for pointing out this issue! &lt;BR /&gt;
We are working on this, trying to make easier to add new navigator item. &lt;BR /&gt;
I'll fix it in the documentation also. &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
    <pubDate>Thu, 16 Jan 2014 14:07:11 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2014-01-16T14:07:11Z</dc:date>
    <item>
      <title>Adding new navigator item [SOLVED TEMPORARILY]</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Adding-new-navigator-item-SOLVED-TEMPORARILY/m-p/211459#M5814</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I am trying to add a navigator item using &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_Environment(APIEnv_NewNavigatorViewID, ...). I followed the sample code on the documentation and just modify the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;parent_child values to the first child (index 0) of navigation set (index 1), but unable to do so.&lt;BR /&gt;&lt;BR /&gt;Here is my code&lt;BR /&gt;
&lt;PRE&gt;if (navi_map_id == API_PublicViewMap &amp;amp;&amp;amp; j == 0)
{
  API_NavigatorItem navi_item;
  navi_item.mapId = API_PublicViewMap;
  navi_item.itemType = API_UndefinedNavItem;
  //navi_item.itemType = API_FolderNavItem;
  sprintf(navi_item.name, "sample navi item");

  // sets the navigator view to default values
  API_NavigatorView navi_view;
  BNZeroMemory(&amp;amp;navi_view, sizeof(API_NavigatorView));

  GS::Guid parent_child[2];
  parent_child[0] = APIGuid2GSGuid((*items).guid);
  parent_child[1] = APIGuid2GSGuid(set.guid);

  err = ACAPI_Environment(APIEnv_NewNavigatorViewID, &amp;amp;navi_item, &amp;amp;navi_view, &amp;amp;parent_child);
  if (err != NoError)
  {
    DBPrintf("ERROR@%d: ACAPI_Environment(APIEnv_NewNavigatorViewID) error 0x%08X [%s]",
      __LINE__ - 4, err, ErrID_To_Name(err));
    continue;
    //return err;
  }
  DBPrintf("Successfully added \"%s\".", navi_item.name);
}&lt;/PRE&gt;
&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;This codes loops to each child of navigator set.&lt;BR /&gt;&lt;BR /&gt;This is the error that I got.&lt;BR /&gt;
&lt;PRE&gt;ERROR@xxx: ACAPI_Environment(APIEnv_NewNavigatorViewID) error 0x81060065 [APIERR_BADID]&lt;/PRE&gt;
If I use the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;API_FolderNavItem and &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;NULL instead of &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;&amp;amp;navi_view, I am able to add it. But other than that, I failed. Is there a rule set for each type, like this type (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;API_NavigatorItemTypeID) can only be used on this map (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;API_NavigatorMapID)?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;I found out that you need to get and save an existing item by using &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;APIEnv_GetNavigatorItemID as a new &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;API_NavigatorItem. Then use it together with an &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;API_NavigatorView on &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;APIEnv_NewNavigatorViewID.&lt;BR /&gt;
&lt;PRE&gt;API_NavigatorItem navi_item;
BNZeroMemory(&amp;amp;navi_item, sizeof(API_NavigatorItem));
navi_item.mapId = API_ProjectMap;
ACAPI_Environment(APIEnv_GetNavigatorItemID, &amp;amp;some_guid, &amp;amp;navi_item);

API_NavigatorView navi_view;
BNZeroMemory(&amp;amp;navi_view, sizeof(API_NavigatorView));
//... add navi_view settings here

GS::Guid parent_child[2];
//... parent_child guids here

ACAPI_Environment(APIEnv_NewNavigatorViewID, &amp;amp;navi_item, &amp;amp;navi_view, &amp;amp;parent_child);
&lt;/PRE&gt;
Now that I can create it, the problem is I can't add it on a folder. I first tried to create a folder within a folder to see if it is possible to add an item (&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;API_FolderNavItem in this case) within a folder and I am able to do so. I was able to create up to 3 subfolders (if written as a folder path: folder/subfolder1/subfolder2/subfolder3). &lt;STRONG&gt;But not on other item (I used &lt;I&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;API_StoryNavItem in this case).&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;EDIT 2&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Is this the correct &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;parent_child relationship?&lt;BR /&gt;
&lt;PRE&gt;:
|-- parent_item_guid
| |-- &amp;lt;APINULLGuid&amp;gt;
| |-- child_item_guid
| |-- *&amp;lt;-- new item here
: :
| '-- last_child_item_guid
:
&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 16:57:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Adding-new-navigator-item-SOLVED-TEMPORARILY/m-p/211459#M5814</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2023-08-01T16:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new navigator item</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Adding-new-navigator-item-SOLVED-TEMPORARILY/m-p/211460#M5815</link>
      <description>&lt;B&gt;I think this is some kind of a bug.&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
When &lt;FONT color="#808080"&gt;ACAPI_Environment(APIEnv_NewNavigatorViewID)&lt;/FONT&gt; is called with the &lt;FONT color="#808080"&gt;parentAndChildGuids&lt;/FONT&gt; argument, it is supposed to put the view on that location.&lt;BR /&gt;
&lt;BR /&gt;
But I found a &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;hack&lt;E&gt;&lt;/E&gt; on this. After creating the said view, I just used &lt;FONT color="#808080"&gt;ACAPI_Environment(APIEnv_SetNavigatorItemPositionID)&lt;/FONT&gt; to change the location of the newly created view to the &lt;FONT color="#808080"&gt;parentAndChildGuids&lt;/FONT&gt; location. It took me a while to figure this out since &lt;FONT color="#808080"&gt;APIEnv_SetNavigatorItemPositionID&lt;/FONT&gt; is not in the list of a &lt;FONT color="#808080"&gt;API_EnvironmentID&lt;/FONT&gt; on &lt;FONT color="#808080"&gt;ACAPI_Environment&lt;/FONT&gt; documentation.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps.</description>
      <pubDate>Thu, 16 Jan 2014 05:28:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Adding-new-navigator-item-SOLVED-TEMPORARILY/m-p/211460#M5815</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2014-01-16T05:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new navigator item [SOLVED TEMPORARILY]</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Adding-new-navigator-item-SOLVED-TEMPORARILY/m-p/211461#M5816</link>
      <description>Hi, &lt;BR /&gt;
 &lt;BR /&gt;
Thanks for pointing out this issue! &lt;BR /&gt;
We are working on this, trying to make easier to add new navigator item. &lt;BR /&gt;
I'll fix it in the documentation also. &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Thu, 16 Jan 2014 14:07:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Adding-new-navigator-item-SOLVED-TEMPORARILY/m-p/211461#M5816</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2014-01-16T14:07:11Z</dc:date>
    </item>
  </channel>
</rss>

