<?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 GSHandle to structure [SOLVED] in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/GSHandle-to-structure-SOLVED/m-p/205585#M5810</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;I have a structure and I saved it on attribute user data using:&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;API_AttributeUserData user_data;
user_data.dataVersion = MY_ATTS_VERS;
user_data.platformSign = GS::Win_Platform_Sign;
user_data.dataHdl = BMAllocateHandle(sizeof(MyUserData), ALLOCATE_CLEAR, 0);
GSErr ud_err = BMPtrToHandle(&amp;amp;UserData, &amp;amp;user_data.dataHdl, sizeof(MyUserData));
ACAPI_Attribute_SetUserData(&amp;amp;UDHead, &amp;amp;user_data);
&lt;/PRE&gt;
UserData is the user data to be saved, and UDHead has the typeID and index.&lt;BR /&gt;&lt;BR /&gt;When I use &lt;STRONG&gt;ACAPI_Attribute_GetUserData()&lt;/STRONG&gt;, I am able to get the version and platform sign. But I am lost in retrieving the saved user data.&lt;BR /&gt;&lt;BR /&gt;Help anyone?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; ArchiCAD 17&lt;/DIV&gt;</description>
    <pubDate>Tue, 01 Aug 2023 16:58:34 GMT</pubDate>
    <dc:creator>ReignBough</dc:creator>
    <dc:date>2023-08-01T16:58:34Z</dc:date>
    <item>
      <title>GSHandle to structure [SOLVED]</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/GSHandle-to-structure-SOLVED/m-p/205585#M5810</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I have a structure and I saved it on attribute user data using:&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;API_AttributeUserData user_data;
user_data.dataVersion = MY_ATTS_VERS;
user_data.platformSign = GS::Win_Platform_Sign;
user_data.dataHdl = BMAllocateHandle(sizeof(MyUserData), ALLOCATE_CLEAR, 0);
GSErr ud_err = BMPtrToHandle(&amp;amp;UserData, &amp;amp;user_data.dataHdl, sizeof(MyUserData));
ACAPI_Attribute_SetUserData(&amp;amp;UDHead, &amp;amp;user_data);
&lt;/PRE&gt;
UserData is the user data to be saved, and UDHead has the typeID and index.&lt;BR /&gt;&lt;BR /&gt;When I use &lt;STRONG&gt;ACAPI_Attribute_GetUserData()&lt;/STRONG&gt;, I am able to get the version and platform sign. But I am lost in retrieving the saved user data.&lt;BR /&gt;&lt;BR /&gt;Help anyone?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; ArchiCAD 17&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 16:58:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/GSHandle-to-structure-SOLVED/m-p/205585#M5810</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2023-08-01T16:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: GSHandle to structure</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/GSHandle-to-structure-SOLVED/m-p/205586#M5811</link>
      <description>Hi, &lt;BR /&gt;
 &lt;BR /&gt;
I think it should work this way: 
&lt;PRE&gt;err = ACAPI_Attribute_GetUserData (&amp;amp;attribute.header, &amp;amp;userData); 
if (err == NoError) { 
	MyUserData** myUserData = reinterpret_cast&amp;lt;MyUserData**&amp;gt; userData.dataHdl; 
	// now you can use the userdata 
	// after working with it, don't forget to free the handle! 
	BMKillHandle (&amp;amp;(userData.dataHdl)); 
} else { 
	ACAPI_WriteReport ("Error: ACAPI_Attribute_GetUserData", false); 
}&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Thu, 17 Oct 2013 12:17:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/GSHandle-to-structure-SOLVED/m-p/205586#M5811</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2013-10-17T12:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: GSHandle to structure</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/GSHandle-to-structure-SOLVED/m-p/205587#M5812</link>
      <description>Thanks Tibor.</description>
      <pubDate>Fri, 18 Oct 2013 01:47:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/GSHandle-to-structure-SOLVED/m-p/205587#M5812</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2013-10-18T01:47:15Z</dc:date>
    </item>
  </channel>
</rss>

