cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Incorrect behavior of ACAPI_Element_GetPropertyValues() in Archicad SE 2022

Emkave
Contributor

Good day everyone. I have the following code snippet:

 

API_SelectionInfo selectionInfo;
GS::Array<API_Neig> neigs;
rapidjson::Document document(rapidjson::kArrayType);
document.SetArray();
rapidjson::Value value;
value.SetObject();

auto err = ACAPI_Selection_Get(&selectionInfo, &neigs, false);
BMKillHandle((GSHandle*)&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& neig : neigs) {

    element.header.guid = neig.guid;
    if (ACAPI_Element_Get(&element) != NoError)
        continue;

    GS::Array<API_PropertyDefinition> definitions;

    if (ACAPI_Element_GetPropertyDefinitions(neig.guid, API_PropertyDefinitionFilter_All, definitions) != NoError)
        return CALLBACK_REMOTE_NACK;

    GS::Array<API_Property> properties;

    if (ACAPI_Element_GetPropertyValues(neig.guid, definitions, properties) != NoError)
        return CALLBACK_REMOTE_NACK;

... (the rest is ok)

}



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.

Have somebody had something like this anomaly behavior?

 

Operating system used: Windows 11

0 REPLIES 0

Setup info provided by author