cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.

ACAPI_ProjectOperation_Open returned -7003

NH
Participant

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);
4 REPLIES 4
NH
Participant

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.

Akos Somorjai
Graphisoft
Graphisoft

Hi,

 

What happens if you don't specify the fileTypeID? The code should be able to derive that from the file extension.

 

Best, Akos

>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.


progress.jpg

By the way, the attached IFC file I'm using is just random data for experimental purposes, but it is a proper IFC file that can be loaded by clicking "Open" in the UI.

 

Thank you in advance.