<?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: Guid of Favorite, and set default classification in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Guid-of-Favorite-and-set-default-classification/m-p/292286#M2724</link>
    <description>Hi, thanks for your reply.&lt;BR /&gt;
It had got fixed by adding the following:&lt;BR /&gt;
favorite.classifications.New();</description>
    <pubDate>Sat, 21 Mar 2020 09:20:12 GMT</pubDate>
    <dc:creator>dushyant</dc:creator>
    <dc:date>2020-03-21T09:20:12Z</dc:date>
    <item>
      <title>Guid of Favorite, and set default classification</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Guid-of-Favorite-and-set-default-classification/m-p/292284#M2722</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I got the default element guid like this:&lt;BR /&gt;&lt;BR /&gt;GS::Array&amp;lt;GS::Pair&amp;lt;API_Guid, API_Guid&amp;gt;&amp;gt; systemItemPairs;&lt;BR /&gt;ACAPI_Element_GetClassificationItemsDefault(typeID, variationID, systemItemPairs);&lt;BR /&gt;for (auto i = systemItemPairs.Begin(); i != systemItemPairs.End(); ++i) {&lt;BR /&gt;system.guid = i-&amp;gt;first;&lt;BR /&gt;item.guid = i-&amp;gt;second;&lt;BR /&gt;ACAPI_WriteReport("\nsystem guid: %d\n item guid: %d\n", false, system.guid, item.guid);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Not able to get the guid of a favorite. Trying like this:&lt;BR /&gt;&lt;BR /&gt;GS::UniString favName;&lt;BR /&gt;favName = "myFav";&lt;BR /&gt;API_Favorite favorite (favName);&lt;BR /&gt;API_Element&amp;amp; favElement = favorite.element;&lt;BR /&gt;ACAPI_WriteReport("favElement.header.guid: %d", false, favElement.header.guid);&lt;BR /&gt;&lt;BR /&gt;The above code outputs the guid as 0.&lt;BR /&gt;&lt;BR /&gt;Tried to get the systemItemPair of the favorite like this:&lt;BR /&gt;&lt;BR /&gt;ACAPI_Element_GetClassificationItems(favElement.header.guid, favorite.classifications.Get());&lt;BR /&gt;&lt;BR /&gt;and fed it into the for-loop like for default, it gave out a huge list of pairs instead of just one for the favorite in question.&lt;BR /&gt;&lt;BR /&gt;I am able to clear the default Classification:&lt;BR /&gt;ACAPI_Element_RemoveClassificationItemDefault(typeID, variationID, item.guid);&lt;BR /&gt;&lt;BR /&gt;But the default Classification is not getting set by:&lt;BR /&gt;ACAPI_Element_AddClassificationItemDefault(typeID, variationID, favElement.header.guid);&lt;BR /&gt;&lt;BR /&gt;Possibly because this guid is 0.&lt;BR /&gt;&lt;BR /&gt;What am I doing wrong?&lt;BR /&gt;&lt;BR /&gt;Please help!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Dushyant&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Jul 2023 11:59:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Guid-of-Favorite-and-set-default-classification/m-p/292284#M2722</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2023-07-04T11:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Guid of Favorite, and set default classification</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Guid-of-Favorite-and-set-default-classification/m-p/292285#M2723</link>
      <description>Hey,&lt;BR /&gt;
You can get a Favorite by:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;API_Favorite favorite;
favorite.name = "myFav";
ACAPI_Favorite_Get (&amp;amp;favorite);
&lt;/PRE&gt;

You can read more about favorites here:&lt;BR /&gt;
&lt;A href="http://archicadapi.graphisoft.com/documentation/api_favorite" target="_blank"&gt;&lt;LINK_TEXT text="http://archicadapi.graphisoft.com/docum ... i_favorite"&gt;http://archicadapi.graphisoft.com/documentation/api_favorite&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Does it help your other problem?</description>
      <pubDate>Fri, 20 Mar 2020 15:39:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Guid-of-Favorite-and-set-default-classification/m-p/292285#M2723</guid>
      <dc:creator>akomporday</dc:creator>
      <dc:date>2020-03-20T15:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Guid of Favorite, and set default classification</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Guid-of-Favorite-and-set-default-classification/m-p/292286#M2724</link>
      <description>Hi, thanks for your reply.&lt;BR /&gt;
It had got fixed by adding the following:&lt;BR /&gt;
favorite.classifications.New();</description>
      <pubDate>Sat, 21 Mar 2020 09:20:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Guid-of-Favorite-and-set-default-classification/m-p/292286#M2724</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2020-03-21T09:20:12Z</dc:date>
    </item>
  </channel>
</rss>

