2025-12-04 05:58 AM
The following code for loading IFC files, which worked in ArchiCAD 28, now returns error -7003 in ArchiCAD 29.
The same procedure works fine with pln files.
What could the problem be?
API_FileOpenPars fop;
BNZeroMemory(&fop, sizeof(API_FileOpenPars));
fop.fileTypeID = APIFType_IfcFile;
fop.useStoredLib = true;
GS::UniString IfcFile = <The correct Ifc file path>;
IO::Location IfcLoc(IfcFile.ToCStr());
fop.file = &IfcLoc;
err = ACAPI_ProjectOperation_Open(&fop);
2025-12-04 07:37 AM
I checked the definition of "APIFType_IfcFile", which I hadn't checked before, and found that it says "save only".
As far as I can tell, it seems to have been written as such since ArchiCAD 21, so perhaps it was just a coincidence that it was usable until now, and that it became fully unusable in ArchiCAD 29, when IFC implementation became stricter?
If there are any alternative methods, I would appreciate it if you could let me know.
4 weeks ago
Hi,
What happens if you don't specify the fileTypeID? The code should be able to derive that from the file extension.
Best, Akos
4 weeks ago
>What happens if you don't specify the fileTypeID? The code should be able to derive that from the file extension.
In this case, "err = ACAPI_ProjectOperation_Open(&fop);" will return "APIERR_BADPARS" and nothing will happen.
If "APIFType_IfcFile" is specified, a progress dialog like the one in the attached image will be displayed and the "open" operation will proceed partway, but ultimately the error "-7003" will be returned and the "open" will fail.
4 weeks ago
yesterday - last edited yesterday
Hello,
I simpified your code a little bit (see below) and tried it on my Mac in Archicad 29 (build 3200), and in the current development version, and file was opened in both cases without any error. Also, I haven't seen any IFC-related fixes in the Archicad 29 code since the release.
Could you please recheck with this code?
Thanks, Ákos
API_FileOpenPars fop {};
fop.fileTypeID = APIFType_IfcFile;
fop.useStoredLib = true;
GS::UniString IfcFile ("/Users/somorjai/Downloads/LightCadOut.Ifc");
IO::Location IfcLoc (IfcFile);
fop.file = &IfcLoc;
GSErrCode err = ACAPI_ProjectOperation_Open (&fop);