<?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: [SOLVED] IFC name in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256671#M5524</link>
    <description>&lt;PRE&gt;char* cString = gsUniString.ToCStr ().Get ();&lt;/PRE&gt;

Found  better solution simple just:
&lt;PRE&gt; const char* cString = gsUniString.ToCStr().Get();&lt;/PRE&gt;
And everythings works fine &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;</description>
    <pubDate>Wed, 08 Apr 2015 08:30:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-08T08:30:37Z</dc:date>
    <item>
      <title>[SOLVED] IFC name</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256666#M5519</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Is it possible to get IFC name from element guid?&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:28:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256666#M5519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T11:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: IFC name</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256667#M5520</link>
      <description>Sure, you can get all IFC attributes and properties too!&lt;BR /&gt;
&lt;BR /&gt;
Here is sample code for getting IFC name from element guid:
&lt;PRE&gt;bool GetIFCNameFromElementGuid (const API_Guid&amp;amp; element_guid, GS::UniString* ifcName)
{
	GS::Array&amp;lt;API_IFCAttribute&amp;gt;  attributes;

	ACAPI_Element_GetIFCAttributes (element_guid, &amp;amp;attributes);
	for (GS::Array&amp;lt;API_IFCAttribute&amp;gt;::ConstIterator it = attributes.Enumerate (); it != NULL; ++it) {
		if ((*it).attributeName == "Name") {
			*ifcName = (*it).attributeValue;
			return true;
		}
	}

	return false;
}

// Usage:
GS::UniString ifcName;
GetIFCNameFromElementGuid (element_guid, &amp;amp;ifcName);&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2015 09:30:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256667#M5520</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-03-26T09:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] IFC name</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256668#M5521</link>
      <description>How can it convert GS::UniString to string or char ?</description>
      <pubDate>Tue, 07 Apr 2015 13:20:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256668#M5521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-07T13:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] IFC name</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256669#M5522</link>
      <description>&lt;BLOCKQUOTE&gt;New wrote:&lt;BR /&gt;How can it convert GS::UniString to string or char ?&lt;/BLOCKQUOTE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
You can use ToCStr function like this: &lt;BR /&gt;
 
&lt;PRE&gt;GS::UniString gsUniString ("string_inside"); 
 
char* cString = gsUniString.ToCStr ().Get (); 
 
std::string str (gsUniString.ToCStr ());	// std::string str (gsUniString.ToCStr (0, GS::MaxUSize, CC_UTF8));&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Apr 2015 13:50:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256669#M5522</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-04-07T13:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] IFC name</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256670#M5523</link>
      <description>&lt;PRE&gt;char* cString = gsUniString.ToCStr ().Get (); &lt;/PRE&gt; &lt;BR /&gt;
It didn't work like this, maybe i did something wrong, error: that const char* cannot be used to char* &lt;BR /&gt;
Managed to work like this : 
&lt;PRE&gt; char cString[32]; 
for (int ii=0;ii&amp;lt;32;ii++){ 
cString[ii] = *gsUniString.ToCStr (ii).Get ();  
}&lt;/PRE&gt; &lt;BR /&gt;
 ---------------------------------------------------------------------------------------
&lt;PRE&gt;std::string str (gsUniString.ToCStr ());  &lt;/PRE&gt; &lt;BR /&gt;
This way everything worked fine will use function this way. &lt;BR /&gt;
 &lt;BR /&gt;
Again, thanks Tibor  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; .</description>
      <pubDate>Wed, 08 Apr 2015 07:15:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256670#M5523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-08T07:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] IFC name</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256671#M5524</link>
      <description>&lt;PRE&gt;char* cString = gsUniString.ToCStr ().Get ();&lt;/PRE&gt;

Found  better solution simple just:
&lt;PRE&gt; const char* cString = gsUniString.ToCStr().Get();&lt;/PRE&gt;
And everythings works fine &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;</description>
      <pubDate>Wed, 08 Apr 2015 08:30:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-IFC-name/m-p/256671#M5524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-08T08:30:37Z</dc:date>
    </item>
  </channel>
</rss>

