<?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: DG::Browser: How to send a Array from the Browser Control to Archicad? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/DG-Browser-How-to-send-a-Array-from-the-Browser-Control-to/m-p/591711#M9245</link>
    <description>&lt;P&gt;thank you very much for your help!&lt;/P&gt;
&lt;P&gt;it works now! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as a little side note: the problem in my case was not a wrong conversion Method, but a wrong static JS call regristration. The method where JS Functions get registred was using JS::Array instead of JS::Base. this does not work and VS does not show a error. The Compiler does also not tell you that the problem is in the JS Regristation Method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 13:42:16 GMT</pubDate>
    <dc:creator>Joel Buehler</dc:creator>
    <dc:date>2024-03-13T13:42:16Z</dc:date>
    <item>
      <title>DG::Browser: How to send a Array from the Browser Control to Archicad?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DG-Browser-How-to-send-a-Array-from-the-Browser-Control-to/m-p/591706#M9243</link>
      <description>&lt;P&gt;Hehey fellow Developers!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I might have a easy and simple question.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id like to send a array from the browser controll to archicad. i have seen that there is Array class in the JSValues.hpp header. i thought that the usage is similar to the&amp;nbsp;GetStringFromJavaScriptVariable Method used in the DG::Browser example. But i dont get it to work. i do it this way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;	GS::Ref&amp;lt;JS::Array&amp;gt; jsArrayRef = GS::DynamicCast&amp;lt;JS::Array&amp;gt;(jsArray);
	const GS::Array &amp;lt;GS::Ref&amp;lt;JS::Base&amp;gt;&amp;gt;&amp;amp; items = jsArrayRef-&amp;gt;GetItemArray();
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but this gives me errors form the CountedPtrlmpi.hpp.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know how to implement a simple function that takes a JS array from the browser controll and convert it to a GS::Array?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 09:06:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DG-Browser-How-to-send-a-Array-from-the-Browser-Control-to/m-p/591706#M9243</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2024-09-17T09:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: DG::Browser: How to send a Array from the Browser Control to Archicad?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DG-Browser-How-to-send-a-Array-from-the-Browser-Control-to/m-p/591709#M9244</link>
      <description>&lt;P&gt;Sth like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;GS::Array&amp;lt;API_Guid&amp;gt;* ConvertFromJsArray2GuidsArray(GS::Ref&amp;lt;JS::Base&amp;gt; jsVariable)
{
    GS::Ref&amp;lt;JS::Array&amp;gt; jsArray = GS::DynamicCast&amp;lt;JS::Array&amp;gt;(jsVariable);
    if (DBVERIFY(jsArray != nullptr)) {
        GS::Array&amp;lt;API_Guid&amp;gt;* guids = new GS::Array&amp;lt;API_Guid&amp;gt;();
        GS::Array&amp;lt;GS::Ref&amp;lt;JS::Base&amp;gt;&amp;gt; items = jsArray-&amp;gt;GetItemArray();
        for (const GS::Ref&amp;lt;JS::Base&amp;gt; guid : items) {
            guids-&amp;gt;PushNew(APIGuidFromString(GS::DynamicCast&amp;lt;JS::Value&amp;gt;(guid)-&amp;gt;GetString().ToCStr().Get()));
        }
        return guids;
    }
    return nullptr;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 17:09:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DG-Browser-How-to-send-a-Array-from-the-Browser-Control-to/m-p/591709#M9244</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2024-03-10T17:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: DG::Browser: How to send a Array from the Browser Control to Archicad?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DG-Browser-How-to-send-a-Array-from-the-Browser-Control-to/m-p/591711#M9245</link>
      <description>&lt;P&gt;thank you very much for your help!&lt;/P&gt;
&lt;P&gt;it works now! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as a little side note: the problem in my case was not a wrong conversion Method, but a wrong static JS call regristration. The method where JS Functions get registred was using JS::Array instead of JS::Base. this does not work and VS does not show a error. The Compiler does also not tell you that the problem is in the JS Regristation Method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 13:42:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DG-Browser-How-to-send-a-Array-from-the-Browser-Control-to/m-p/591711#M9245</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2024-03-13T13:42:16Z</dc:date>
    </item>
  </channel>
</rss>

