<?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: Type conversion GS::Unistring to GS::uchar_t[] in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Type-conversion-GS-Unistring-to-GS-uchar-t/m-p/244190#M3008</link>
    <description>One example from the Element_Test example Add-On:
&lt;PRE&gt;const GS::UniString tmpUStr ("TestName");
GS::ucscpy ((*memo.params)[ii].value.uStr, tmpUStr.ToUStr ());&lt;/PRE&gt;</description>
    <pubDate>Wed, 31 Jul 2019 10:48:03 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2019-07-31T10:48:03Z</dc:date>
    <item>
      <title>Type conversion GS::Unistring to GS::uchar_t[]</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Type-conversion-GS-Unistring-to-GS-uchar-t/m-p/244189#M3007</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hey everyone,&lt;BR /&gt;&lt;BR /&gt;i need to set a GDL param value from my addon and i struggle to define my new value with the correct type.&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;UInt32 totalParams = BMGetHandleSize((GSConstHandle)memo.params) / sizeof(API_AddParType);
for (int i=0; i&amp;lt;totalParams ;i++){
   GS::UniString pname = ((*memo.params)&lt;I&gt;.name);
   if (pname=="search name"){
      GS::UniString old_value = (*memo.params)&lt;I&gt;.value.uStr;
      (*memo.params)&lt;I&gt;.value.uStr = "???????";   // how to set this
   }
}
&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
As i understand (*memo.params)&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;.value.uStr gives me an array of GS::uchar_t values. How is the correct constructor for something like this
&lt;PRE&gt;GS::uchar_t my_chars[5] = ???; &lt;/PRE&gt;
or can i convert a GS::Unistring to an uchar_t array? uchart_t seemes to be just a Utf16Char but i lack the understanding of those types. Any help would be aprreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;Edit: &lt;BR /&gt;(*memo.params)&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;.value.uStr = "???????"; will not work but i found the example in the docs for APIAny_​OpenParametersID so i will use that. The question of the type conversion still reamains.&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:25:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Type-conversion-GS-Unistring-to-GS-uchar-t/m-p/244189#M3007</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-04T14:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Type conversion GS::Unistring to GS::uchar_t[]</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Type-conversion-GS-Unistring-to-GS-uchar-t/m-p/244190#M3008</link>
      <description>One example from the Element_Test example Add-On:
&lt;PRE&gt;const GS::UniString tmpUStr ("TestName");
GS::ucscpy ((*memo.params)[ii].value.uStr, tmpUStr.ToUStr ());&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jul 2019 10:48:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Type-conversion-GS-Unistring-to-GS-uchar-t/m-p/244190#M3008</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2019-07-31T10:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Type conversion GS::Unistring to GS::uchar_t[]</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Type-conversion-GS-Unistring-to-GS-uchar-t/m-p/244191#M3009</link>
      <description>As allways, thank you very much Tibor! It's sometimes hard to find the things you are looking for in the examples so thank you for pointing that out as well.</description>
      <pubDate>Wed, 31 Jul 2019 12:09:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Type-conversion-GS-Unistring-to-GS-uchar-t/m-p/244191#M3009</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-31T12:09:43Z</dc:date>
    </item>
  </channel>
</rss>

