3 weeks ago
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);
3 weeks ago
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.
a week 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
Tuesday
>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.
Tuesday