<?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 Incorrect behavior of ACAPI_Element_GetPropertyValues() in Archicad SE 2022 in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-behavior-of-ACAPI-Element-GetPropertyValues-in/m-p/631927#M45741</link>
    <description>&lt;P&gt;Good day everyone. I have the following code snippet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;API_SelectionInfo selectionInfo;
GS::Array&amp;lt;API_Neig&amp;gt; neigs;
rapidjson::Document document(rapidjson::kArrayType);
document.SetArray();
rapidjson::Value value;
value.SetObject();

auto err = ACAPI_Selection_Get(&amp;amp;selectionInfo, &amp;amp;neigs, false);
BMKillHandle((GSHandle*)&amp;amp;selectionInfo.marquee.coords);
bool selection_empty = err == APIERR_NOSEL;

if (err == APIERR_NOSEL)
    err = NoError;
if (err != NoError)
    return CALLBACK_REMOTE_NACK;
API_Element element;

for (const API_Neig&amp;amp; neig : neigs) {

    element.header.guid = neig.guid;
    if (ACAPI_Element_Get(&amp;amp;element) != NoError)
        continue;

    GS::Array&amp;lt;API_PropertyDefinition&amp;gt; definitions;

    if (ACAPI_Element_GetPropertyDefinitions(neig.guid, API_PropertyDefinitionFilter_All, definitions) != NoError)
        return CALLBACK_REMOTE_NACK;

    GS::Array&amp;lt;API_Property&amp;gt; properties;

    if (ACAPI_Element_GetPropertyValues(neig.guid, definitions, properties) != NoError)
        return CALLBACK_REMOTE_NACK;

... (the rest is ok)

}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;When I run this code for AC25 - it is all ok. When I do the same for AC SE 2022, it fails at ACAPI_Element_GetPropertyValues(). I am not sure why. I was debugging carefully that part of the code. It was pointing to the correct guid. Hence, it should return the correct property definition which would be used for getting property values, however, that does not happen in AC SE 2022.&lt;BR /&gt;&lt;BR /&gt;Have somebody had something like this anomaly behavior?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="grey"&gt;Operating system used: &lt;EM&gt;Windows 11&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2024 19:18:03 GMT</pubDate>
    <dc:creator>Emkave</dc:creator>
    <dc:date>2024-09-23T19:18:03Z</dc:date>
    <item>
      <title>Incorrect behavior of ACAPI_Element_GetPropertyValues() in Archicad SE 2022</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-behavior-of-ACAPI-Element-GetPropertyValues-in/m-p/631927#M45741</link>
      <description>&lt;P&gt;Good day everyone. I have the following code snippet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;API_SelectionInfo selectionInfo;
GS::Array&amp;lt;API_Neig&amp;gt; neigs;
rapidjson::Document document(rapidjson::kArrayType);
document.SetArray();
rapidjson::Value value;
value.SetObject();

auto err = ACAPI_Selection_Get(&amp;amp;selectionInfo, &amp;amp;neigs, false);
BMKillHandle((GSHandle*)&amp;amp;selectionInfo.marquee.coords);
bool selection_empty = err == APIERR_NOSEL;

if (err == APIERR_NOSEL)
    err = NoError;
if (err != NoError)
    return CALLBACK_REMOTE_NACK;
API_Element element;

for (const API_Neig&amp;amp; neig : neigs) {

    element.header.guid = neig.guid;
    if (ACAPI_Element_Get(&amp;amp;element) != NoError)
        continue;

    GS::Array&amp;lt;API_PropertyDefinition&amp;gt; definitions;

    if (ACAPI_Element_GetPropertyDefinitions(neig.guid, API_PropertyDefinitionFilter_All, definitions) != NoError)
        return CALLBACK_REMOTE_NACK;

    GS::Array&amp;lt;API_Property&amp;gt; properties;

    if (ACAPI_Element_GetPropertyValues(neig.guid, definitions, properties) != NoError)
        return CALLBACK_REMOTE_NACK;

... (the rest is ok)

}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;When I run this code for AC25 - it is all ok. When I do the same for AC SE 2022, it fails at ACAPI_Element_GetPropertyValues(). I am not sure why. I was debugging carefully that part of the code. It was pointing to the correct guid. Hence, it should return the correct property definition which would be used for getting property values, however, that does not happen in AC SE 2022.&lt;BR /&gt;&lt;BR /&gt;Have somebody had something like this anomaly behavior?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="grey"&gt;Operating system used: &lt;EM&gt;Windows 11&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 19:18:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-behavior-of-ACAPI-Element-GetPropertyValues-in/m-p/631927#M45741</guid>
      <dc:creator>Emkave</dc:creator>
      <dc:date>2024-09-23T19:18:03Z</dc:date>
    </item>
  </channel>
</rss>

