We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

APIERR_BADWINDOW when save as ifc

Anonymous
Not applicable
Hello.

I am trying to save as an IFC file in ArchiCAD 22.

But I got the APIERR_BADWINDOW error code from ACAPI_Automate(APIDo_SaveID, &fsp, &pars_ifc).

The following are the parameters entered before running ACAPI_Automate.
GS::UniString filePath = L"C:\\...............ifc";
API_FileSavePars fsp;
API_SavePars_Ifc pars_ifc;
BNZeroMemory(&fsp, sizeof(API_FileSavePars));
BNZeroMemory(&pars_ifc, sizeof(API_SavePars_Ifc));
fsp.fileTypeID = APIFType_IfcFile;
fsp.file = new IO::Location(filePath);
pars_ifc.subType = API_IFC;

I don't know why I got this error.

It works on the computer I've been developing on, but I get errors on a few other computers.
1 REPLY 1
Viktor Kovacs
Graphisoft
Graphisoft
APIERR_BADWINDOW usually means that the required operation is not possible over the currently opened window type. IFC export works only when you are in a 2D or 3D window, but it doesn't available when you are in, for example, a section window. The API works the same as Archicad, it returns APIERR_BADWINDOW if you are in a window where the command is not available.