cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.

APIEnv_GetDocumentFrom3DSettingsID crashes

PetteriHeiskari
Participant

Hi all, my first post here...

 

So ACAPI_Environment( APIEnv_GetDocumentFrom3DSettingsID, ...) crashes with AC26 and AC27 (in AC27 I have tested the native version). Any workaround or estimate when the fix will be?

 

I have made a video to show steps to reproduce here.

 

Thank you!

 

Petteri Heiskari, ArchiFrame guy

4 REPLIES 4
Akos Somorjai
Graphisoft
Graphisoft

Hi Petteri,

 

Could you please tell us the bug ID?

 

Thanks, Akos

Hi Ákos, sorry - don't have the crash report ID but you can easily reproduce this using the DevKit example project. Please see the linked video for the steps.

 

Köszönöm szépen, Petteri

Akos Somorjai
Graphisoft
Graphisoft

Hi Petteri,

 

No problem, I found it in our bug database. The issue seems to be around the initialization of the `filterAndCutSettings` member of `API_DocumentFrom3DType`, it contains a std::map that seems to cause the crash.

The good news is that I can reproduce it in AC26 even on my Mac, but not in AC27 or AC28. However, I don't see any change in that part of the source that would explain this behavior, so I'll have to dig deeper.

 

Best, Ákos

PetteriHeiskari
Participant

Hi Ákos,

 

now I have a crash ID for AC27:

AC27-2024-08-27-09-39-56-6516

 

Another one without VS debugger running:

AC27-2024-08-27-09-44-56-1900

 

The related file here.

 

And what I did was to do the bolded call on the active 3D document:

 

// Addition 2/2024: Support picking marquee from 3D document if axonometry
API_DatabaseInfo rDbInfo;
API_DocumentFrom3DType rDocFrom3D;
 
if (ACAPI_Database(APIDb_GetCurrentDatabaseID, &rDbInfo, NULL) == 0 && rDbInfo.typeID == APIWind_DocumentFrom3DID &&
ACAPI_View_GetDocumentFrom3DSettings(&rDbInfo.databaseUnId, &rDocFrom3D) == 0 && rDocFrom3D.projectionSetting.isPersp == false)
{
    // Do something
}

 

Best regards, Petteri