License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.

[API] Has been something changed in DXF/DWG add-on since AC24?

Dejmas
Participant

Hello developers,

I am maintaining a plugin for a couple of last versions of the Archicad. The following code had been working overtime. I use it to import my DWG files as LibPart through the plugin. Since AC24 it has been getting a crush on ACAPI_Command_Call. When I try to import the same file manually, it works then. 

 

		API_ModulID	mdid = { 1198731108, 1322668197 };		// DXF/DWG add-on
		GSErrCode	err;
		// call the Dxf add-on
		GSHandle parHdl;
		err = ACAPI_Goodies(APIAny_InitMDCLParameterListID, &parHdl);
		if (err != NoError) {
			WriteReport_Err("APIAny_InitMDCLParameterListID", err);
		}
		if (err == NoError) {
			IO::URL url;
			dwgFileLoc.ToURL(&url);

			API_MDCLParameter par;
			BNZeroMemory(&par, sizeof(par));
			par.name = "FileName";
			par.type = MDCLPar_string;

			char str[512] = { 0 };
			CHTruncate((const char*)url, str, sizeof(str));
			par.string_par = str;
			err = ACAPI_Goodies(APIAny_AddMDCLParameterID, parHdl, &par);
			if (err != NoError) {
				WriteReport_Err("ACAPI_Command_Call", err);
			}

			if (err == NoError) {
				err = ACAPI_Command_Call(&mdid, 'OOBJ', 1, parHdl, nullptr, true);
				// ^-- From this call it gets access valiation exception since AC 24.
				if (err != NoError) {
					WriteReport_Err("ACAPI_Command_Call", err);
				}
				else WriteReport("No error.");
			}
		}

 

In my case, DXF/DWG addon does its usual job. I am asked about layers to import in. I am asked about a few of SHX files which I just skip. Then it ends with an exception: 

Exception thrown at 0x00007FFDEC97EA72 (DXF_DWG_Engine.dll) in Archicad.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

 Exception rises from  DXF_DWG_Engine.dll and it seems it falls on dereferencing of a null pointer. I am pretty sure that the DXF DWG addon is working well. There have to be something wrong with how I am using it or with the interaction between other plugins. By the way in API DevKit's example CommunicationManager there is a similar code and the same exception rises from it as well for me (Communication_Manager.cpp line 454).
I know this may take a long time. Please let me know if you figure something out.

Best regards

Tomas

0 REPLIES 0