License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…

Archicad C++ API
About Archicad add-on development using the C++ API.

ACAPI_Element_SolidOperation_Create() problem

Anonymous
Not applicable
Hello dear Archicad developers!

Recently have problem with ACAPI_Element_SolidOperation_Create() function in my add-on and ElementTest: Solid Operations example.
I try to intersect 2 morphs that created by user from main Archicad thread (creation without API). Function throw error -2130313215 APIERR_GENERAL: General error code. Both 2 Morph elements haven't changes (they exist in initial view) after that command.
Post code below:

GSErrCode clRDArchiM::RD_SolidOperation ()
{
GS::GSErrCode err_local = GS::NoError; // Init Error code

API_ElemTypeID typeID;
API_Guid guid_Target, guid_Operator;
GS::Array<API_Guid> guid_Results;

if (!ClickAnElem ("Click on a solid operation target", API_MorphID, NULL, &typeID, &guid_Target)) {
WriteReport_Alert ("No element was clicked.");
return err_local;
}

if (!ClickAnElem ("Click on a solid operator element", API_MorphID, NULL, &typeID, &guid_Operator)) {
WriteReport_Alert ("No element was clicked.");
return err_local;
}

err_local = ACAPI_CallUndoableCommand ("Solid Operation intersection",[&] () -> GSErrCode {
return ACAPI_Element_SolidOperation_Create(guid_Target, guid_Operator, APISolid_Intersect, &guid_Results);
});


if (err_local != NoError)
{
if (err_local == APIERR_NO3D)
WriteReport_Alert ("Solid operation targets and operators can be freeshape elements only.");
else
WriteReport_Alert ("ACAPI_Element_SolidOperation_Create failed: %d", err_local);
}
return err_local;
};

Please help me in this problem. Thank You!
3 REPLIES 3
Akos Somorjai
Graphisoft
Graphisoft
DimRad wrote:
Hello dear ArchiCAD developers!

Recently have problem with ACAPI_Element_SolidOperation_Create() function in my add-on and ElementTest: Solid Operations example.
I try to intersect 2 morphs that created by user from main ArchiCAD thread (creation without API). Function throw error -2130313215 APIERR_GENERAL: General error code. Both 2 Morph elements haven't changes (they exist in initial view) after that command.
Post code below:

GSErrCode clRDArchiM::RD_SolidOperation ()
{
GS::GSErrCode err_local = GS::NoError; // Init Error code

API_ElemTypeID typeID;
API_Guid guid_Target, guid_Operator;
GS::Array<API_Guid> guid_Results;

if (!ClickAnElem ("Click on a solid operation target", API_MorphID, NULL, &typeID, &guid_Target)) {
WriteReport_Alert ("No element was clicked.");
return err_local;
}

if (!ClickAnElem ("Click on a solid operator element", API_MorphID, NULL, &typeID, &guid_Operator)) {
WriteReport_Alert ("No element was clicked.");
return err_local;
}

err_local = ACAPI_CallUndoableCommand ("Solid Operation intersection",[&] () -> GSErrCode {
return ACAPI_Element_SolidOperation_Create(guid_Target, guid_Operator, APISolid_Intersect, &guid_Results);
});


if (err_local != NoError)
{
if (err_local == APIERR_NO3D)
WriteReport_Alert ("Solid operation targets and operators can be freeshape elements only.");
else
WriteReport_Alert ("ACAPI_Element_SolidOperation_Create failed: %d", err_local);
}
return err_local;
};

Please help me in this problem. Thank You!
Hi,

This is not your fault; it's a bug has been fixed in ARCHICAD 20 build 6529, and in ARCHICAD 21 build 3513.

Best, Akos
Anonymous
Not applicable
Oh, it's wonderfull! 'Cause I spend a week reading documentation and debugging code thinking it's my bug.
But here is another question - where can I download latest ArchiCAD 20 update 6529? On International site I see only build 6005 and on Russian localization site 5025.

Thank You in advance!
Akos Somorjai
Graphisoft
Graphisoft
DimRad wrote:
Oh, it's wonderfull! 'Cause I spend a week reading documentation and debugging code thinking it's my bug.
But here is another question - where can I download latest ArchiCAD 20 update 6529? On International site I see only build 6005 and on Russian localization site 5025.

Thank You in advance!
That update hasn't been published yet, sorry.

Best, Akos