<?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 API_Favorite_Get() fails in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Favorite-Get-fails/m-p/291106#M2666</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am trying to load a favourite by API_Favorite_Get() using an API_Favorite made with favorite’s name as string. It fails. Whereas if I pass the name out of the array names[0], it works. Why is this happening? Code snippet pasted below. &lt;BR /&gt;&lt;BR /&gt;Thanks, Dushyant.&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;   GSErrCode                    err = NoError;
   GS::UniString                favName;
   short                        count = 0;
   GS::Array&amp;lt;GS::UniString&amp;gt;     names;

   err = ACAPI_Favorite_GetNum (API_ColumnID,
                                APIVarId_Generic,
                                &amp;amp;count,
                                nullptr,
                                &amp;amp;names);

   favName = "Column - Rectangular”;
   //favName = names[0]; // this actually is ‘Column - Rectangular'

   API_Favorite    favorite (favName);
   ACAPI_WriteReport("API_Favorite - name: %s", false, favorite.name.ToCStr().Get());
   favorite.memo.New ();

   err = ACAPI_Favorite_Get (&amp;amp;favorite);
   if (err != NoError) {
       ACAPI_WriteReport ("ACAPI_Favorite_Get failed (Name: %s)", false, favName.ToCStr().Get());
       ACAPI_WriteReport ("err: %d", false, err);
       ACAPI_DisposeElemMemoHdls (&amp;amp;favorite.memo.Get ());
       return;
   }&lt;/PRE&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 29 Sep 2022 07:39:29 GMT</pubDate>
    <dc:creator>dushyant</dc:creator>
    <dc:date>2022-09-29T07:39:29Z</dc:date>
    <item>
      <title>API_Favorite_Get() fails</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Favorite-Get-fails/m-p/291106#M2666</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am trying to load a favourite by API_Favorite_Get() using an API_Favorite made with favorite’s name as string. It fails. Whereas if I pass the name out of the array names[0], it works. Why is this happening? Code snippet pasted below. &lt;BR /&gt;&lt;BR /&gt;Thanks, Dushyant.&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;   GSErrCode                    err = NoError;
   GS::UniString                favName;
   short                        count = 0;
   GS::Array&amp;lt;GS::UniString&amp;gt;     names;

   err = ACAPI_Favorite_GetNum (API_ColumnID,
                                APIVarId_Generic,
                                &amp;amp;count,
                                nullptr,
                                &amp;amp;names);

   favName = "Column - Rectangular”;
   //favName = names[0]; // this actually is ‘Column - Rectangular'

   API_Favorite    favorite (favName);
   ACAPI_WriteReport("API_Favorite - name: %s", false, favorite.name.ToCStr().Get());
   favorite.memo.New ();

   err = ACAPI_Favorite_Get (&amp;amp;favorite);
   if (err != NoError) {
       ACAPI_WriteReport ("ACAPI_Favorite_Get failed (Name: %s)", false, favName.ToCStr().Get());
       ACAPI_WriteReport ("err: %d", false, err);
       ACAPI_DisposeElemMemoHdls (&amp;amp;favorite.memo.Get ());
       return;
   }&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Sep 2022 07:39:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Favorite-Get-fails/m-p/291106#M2666</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2022-09-29T07:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: API_Favorite_Get() fails</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Favorite-Get-fails/m-p/291107#M2667</link>
      <description>The error was: &lt;BR /&gt;
Name of the column had a space at the end, so it should be: "Column - Rectangular ", for reference of others.</description>
      <pubDate>Mon, 03 Feb 2020 12:34:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Favorite-Get-fails/m-p/291107#M2667</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2020-02-03T12:34:54Z</dc:date>
    </item>
  </channel>
</rss>

