<?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: Use of ACAPI_element_UnIdToGuid in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122678#M6111</link>
    <description>Please some one help me in this issue.</description>
    <pubDate>Fri, 05 Nov 2010 04:02:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-11-05T04:02:31Z</dc:date>
    <item>
      <title>Use of ACAPI_element_UnIdToGuid</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122675#M6108</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a drawing in ArchiCAD 9.0, in which one element stores the ‘unId’ of other element as the parameter ‘parent_unId’. (That is the way we relate each other elements parent child relation ship).&lt;BR /&gt;In this scenario my parent element is door element and child is door extra element.&lt;BR /&gt;&lt;BR /&gt;Now we are opening this drawing with ArchiCAD 13.0 I need to convert ‘parent_unid’ to API_Guid.&lt;BR /&gt;I am trying to use following function when I receive APINotify_ConvertUnId notification.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;OSErr DOConvertUnId()
{
	API_Element element;
	API_ElementMemo memo;
	API_DatabaseInfo dbInfo;
	API_Guid parentGuid = APINULLGuid;
	Int32 ii, num;

	SetDB(FLOORPLAN);//our function
	BNZeroMemory(&amp;amp;dbInfo, sizeof(API_DatabaseInfo));
	if(ACAPI_Database(APIDb_GetCurrentDatabaseID, &amp;amp;dbInfo, NULL) == NoError)
	{
		ACAPI_Element_GetNum(API_ObjectID, &amp;amp;num);
		for(ii = 1; ii &amp;lt;= num; ii++)
		{
			if(ACAPI_Element_Filter_Index(API_ObjectID, ii, APIFilt_IsEditable))
			{
				memset(&amp;amp;element, 0, sizeof(API_Element);
				element.header.typeID = API_ObjectID;
				element.header.index =ii;
				if(ACAPI_Element_Get(&amp;amp;element) == NoError &amp;amp;&amp;amp; element.object.libInd == utLibIndStore-&amp;gt;DoorExtraInd)
				{
					memset(&amp;amp;memo, 0, sizeof(API_elementMemo);
					if(ACAPI_Element_GetMemo(element.header.guid, &amp;amp;memo) == NoError)
					{
						parentGuid = ACAPI_element_UnIdToGuid(dbInfo.databaseUnId, (GS::Uint32) GetParamValue(memo.parms, “parent_unid”));
						if(parentGuid != APINULLGuid)
						{
							char guidStr[64];
							APIGuid2GSGuid(parentGuid).ConvertToString(guidStr);
							GiveMsg(guidStr);
						}
					}
				}
			}
		}
	}
}&lt;/PRE&gt;
This function giving the guid message but the guid it displays is of one of the wall (not the wall contained my door), not door.&lt;BR /&gt;&lt;STRONG&gt;I am thinking problem in this function ACAPI_Database(APIDb_GetCurrentDatabaseID, &amp;amp;dbInfo, NULL);&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Can any one please explain me what are the databases I have to look to convert unId to guid and how to use ACAPI_element_UnIdToGuid() function?&lt;BR /&gt;&lt;BR /&gt;Ranga&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 08:53:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122675#M6108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-03T08:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Use of ACAPI_element_UnIdToGuid</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122676#M6109</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I haven't had any experience with this function yet, but I am guessing you should use API_DoorID instead of API_ObjectID.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Hoa</description>
      <pubDate>Fri, 29 Oct 2010 05:01:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122676#M6109</guid>
      <dc:creator>Hoa Tu</dc:creator>
      <dc:date>2010-10-29T05:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use of ACAPI_element_UnIdToGuid</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122677#M6110</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Thanking you for replay.&lt;BR /&gt;
&lt;BR /&gt;
My child element (doorExtra) is an object, which stores the unId of door element. So, first I am getting my doorExtra then I am getting “parent_unid” and try to convert this into guid using this function.&lt;BR /&gt;

&lt;PRE&gt;parentGuid = ACAPI_element_UnIdToGuid(dbInfo.databaseUnId, (GS::Uint32) GetParamValue(memo.parms, "parent_unid"));&lt;/PRE&gt;

But I am getting guid of wall instead of door. ( if I open my drawing with ArchiCAD 9.0 “parent_unid”  stored in the doorExtra object is unId of one of the door.</description>
      <pubDate>Mon, 01 Nov 2010 00:56:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122677#M6110</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-01T00:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use of ACAPI_element_UnIdToGuid</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122678#M6111</link>
      <description>Please some one help me in this issue.</description>
      <pubDate>Fri, 05 Nov 2010 04:02:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Use-of-ACAPI-element-UnIdToGuid/m-p/122678#M6111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-05T04:02:31Z</dc:date>
    </item>
  </channel>
</rss>

