Hello, I've been experimenting on 3D Documents and I've encountered crashing when I use 'APIEnv_GetDocumentFrom3DSettingsID'. Then I checked and run the Database_Control example and it also crashes on that line ' GSErrCode err = ACAPI_Environment (APIEnv_GetDocumentFrom3DSettingsID, &dbPars.databaseUnId, &documentFrom3DType);'.
static void Do_Change3DDocument ()
{
API_DatabaseUnId *dbases = nullptr;
if (ACAPI_Database (APIDb_GetDocumentFrom3DDatabasesID, &dbases) == NoError) {
GSSize nDbases = BMpGetSize (reinterpret_cast<GSPtr>(dbases)) / Sizeof32 (API_DatabaseUnId);
if (nDbases > 0) {
API_DatabaseInfo dbPars;
API_DocumentFrom3DType documentFrom3DType;
BNZeroMemory (&dbPars, sizeof (API_DatabaseInfo));
dbPars.databaseUnId = dbases[0];
GSErrCode err = ACAPI_Environment (APIEnv_GetDocumentFrom3DSettingsID, &dbPars.databaseUnId, &documentFrom3DType);
if (err == NoError) {
documentFrom3DType.attributeOptions.shouldUseUniformCutAttributes = !documentFrom3DType.attributeOptions.shouldUseUniformCutAttributes;
err = ACAPI_Environment (APIEnv_ChangeDocumentFrom3DSettingsID, &dbPars.databaseUnId, &documentFrom3DType);
if (err != NoError)
DBPrintf ("APIEnv_ChangeDocumentFrom3DSettingsID returns with error code");
} else {
DBPrintf ("APIEnv_GetDocumentFrom3DSettingsID returns with error code");
}
BMKillHandle (reinterpret_cast<GSHandle*> (&documentFrom3DType.cutSetting.shapes));
}
}
if (dbases != nullptr)
BMpFree (reinterpret_cast<GSPtr>(dbases));
}
This is the exception detected by Visual Studio
I also tried running the AC25 addon and it works fine so this looks like a problem for AC26 API