<?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: How to get the navigator main tree name? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-the-navigator-main-tree-name/m-p/132327#M5890</link>
    <description>&lt;BLOCKQUOTE&gt;ReignBough wrote:&lt;BR /&gt;Is there any other way on getting this name without calling/getting it from the navigator?&lt;/BLOCKQUOTE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Why don't you want to get it from the navigator? &lt;BR /&gt;
 &lt;BR /&gt;
I would use this code to get that: 
&lt;PRE&gt;API_NavigatorSet set; 
BNZeroMemory (&amp;amp;set, sizeof (API_NavigatorSet)); 
set.mapId = API_ProjectMap; 
GSErrCode err = ACAPI_Environment (APIEnv_GetNavigatorSetID, &amp;amp;set, NULL); 
if (err == NoError) { 
	char buffer[256]; 
	sprintf (buffer, "Project name: %s", set.name); 
	ACAPI_WriteReport (buffer, true); 
 
	// to check root item's name 
	API_NavigatorItem navItem; 
	BNZeroMemory (&amp;amp;navItem, sizeof (API_NavigatorItem)); 
	navItem.mapId = API_ProjectMap; 
	err = ACAPI_Environment (APIEnv_GetNavigatorItemID, &amp;amp;set.rootGuid, &amp;amp;navItem); 
	if (err == NoError) { 
		sprintf (buffer, "Root navigator item name: %s", navItem.name); 
		ACAPI_WriteReport (buffer, true); 
	} 
}&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
    <pubDate>Wed, 05 Feb 2014 09:35:57 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2014-02-05T09:35:57Z</dc:date>
    <item>
      <title>How to get the navigator main tree name?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-the-navigator-main-tree-name/m-p/132326#M5889</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;[See attached file.]&lt;BR /&gt;&lt;BR /&gt;I can get this name by calling &lt;FONT color="#808080"&gt;ACAPI_Environment(APIEnv_GetProjectNotesID)&lt;/FONT&gt; and use the value of &lt;FONT color="#808080"&gt;projectName&lt;/FONT&gt;. When this is empty, I call &lt;FONT color="#808080"&gt;ACAPI_Environment(APIEnv_ProjectID)&lt;/FONT&gt; and check the &lt;FONT color="#808080"&gt;untitled&lt;/FONT&gt; flag: if true, I set the tree name to 'Untitled'; if false, I use the project file name (&lt;FONT color="#808080"&gt;proj_info.location-&amp;gt;GetLastLocalName()&lt;/FONT&gt;). This is true for PLN file.&lt;BR /&gt;&lt;BR /&gt;But when I started from an existing PLA file and follows the steps above the add-on fails. This is because the &lt;FONT color="#808080"&gt;untitled&lt;/FONT&gt; flag is true and the tree name is set to the PLA file name. Also since it is flagged as untitled, the &lt;FONT color="#808080"&gt;location&lt;/FONT&gt; value is empty.&lt;BR /&gt;&lt;BR /&gt;Is there any other way on getting this name without calling/getting it from the navigator?&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/72915iD8CA5B7F0F7B3921/image-size/large?v=v2&amp;amp;px=999" border="0" alt="navigator_tree.jpg" title="navigator_tree.jpg" /&gt;</description>
      <pubDate>Tue, 01 Aug 2023 14:35:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-the-navigator-main-tree-name/m-p/132326#M5889</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2023-08-01T14:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the navigator main tree name?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-the-navigator-main-tree-name/m-p/132327#M5890</link>
      <description>&lt;BLOCKQUOTE&gt;ReignBough wrote:&lt;BR /&gt;Is there any other way on getting this name without calling/getting it from the navigator?&lt;/BLOCKQUOTE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Why don't you want to get it from the navigator? &lt;BR /&gt;
 &lt;BR /&gt;
I would use this code to get that: 
&lt;PRE&gt;API_NavigatorSet set; 
BNZeroMemory (&amp;amp;set, sizeof (API_NavigatorSet)); 
set.mapId = API_ProjectMap; 
GSErrCode err = ACAPI_Environment (APIEnv_GetNavigatorSetID, &amp;amp;set, NULL); 
if (err == NoError) { 
	char buffer[256]; 
	sprintf (buffer, "Project name: %s", set.name); 
	ACAPI_WriteReport (buffer, true); 
 
	// to check root item's name 
	API_NavigatorItem navItem; 
	BNZeroMemory (&amp;amp;navItem, sizeof (API_NavigatorItem)); 
	navItem.mapId = API_ProjectMap; 
	err = ACAPI_Environment (APIEnv_GetNavigatorItemID, &amp;amp;set.rootGuid, &amp;amp;navItem); 
	if (err == NoError) { 
		sprintf (buffer, "Root navigator item name: %s", navItem.name); 
		ACAPI_WriteReport (buffer, true); 
	} 
}&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Wed, 05 Feb 2014 09:35:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-the-navigator-main-tree-name/m-p/132327#M5890</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2014-02-05T09:35:57Z</dc:date>
    </item>
  </channel>
</rss>

