<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [API] Has been something changed in DXF/DWG add-on since AC24? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Has-been-something-changed-in-DXF-DWG-add-on-since-AC24/m-p/305780#M8161</link>
    <description>&lt;P&gt;Hello developers,&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;		API_ModulID	mdid = { 1198731108, 1322668197 };		// DXF/DWG add-on
		GSErrCode	err;
		// call the Dxf add-on
		GSHandle parHdl;
		err = ACAPI_Goodies(APIAny_InitMDCLParameterListID, &amp;amp;parHdl);
		if (err != NoError) {
			WriteReport_Err("APIAny_InitMDCLParameterListID", err);
		}
		if (err == NoError) {
			IO::URL url;
			dwgFileLoc.ToURL(&amp;amp;url);

			API_MDCLParameter par;
			BNZeroMemory(&amp;amp;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, &amp;amp;par);
			if (err != NoError) {
				WriteReport_Err("ACAPI_Command_Call", err);
			}

			if (err == NoError) {
				err = ACAPI_Command_Call(&amp;amp;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.");
			}
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Exception thrown at 0x00007FFDEC97EA72 (DXF_DWG_Engine.dll) in Archicad.exe: 0xC0000005: Access violation reading location 0x0000000000000000.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Exception rises from&amp;nbsp; 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).&lt;BR /&gt;I know this may take a long time. Please let me know if you figure something out.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;</description>
    <pubDate>Sun, 12 Sep 2021 23:58:46 GMT</pubDate>
    <dc:creator>Dejmas</dc:creator>
    <dc:date>2021-09-12T23:58:46Z</dc:date>
    <item>
      <title>[API] Has been something changed in DXF/DWG add-on since AC24?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Has-been-something-changed-in-DXF-DWG-add-on-since-AC24/m-p/305780#M8161</link>
      <description>&lt;P&gt;Hello developers,&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;		API_ModulID	mdid = { 1198731108, 1322668197 };		// DXF/DWG add-on
		GSErrCode	err;
		// call the Dxf add-on
		GSHandle parHdl;
		err = ACAPI_Goodies(APIAny_InitMDCLParameterListID, &amp;amp;parHdl);
		if (err != NoError) {
			WriteReport_Err("APIAny_InitMDCLParameterListID", err);
		}
		if (err == NoError) {
			IO::URL url;
			dwgFileLoc.ToURL(&amp;amp;url);

			API_MDCLParameter par;
			BNZeroMemory(&amp;amp;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, &amp;amp;par);
			if (err != NoError) {
				WriteReport_Err("ACAPI_Command_Call", err);
			}

			if (err == NoError) {
				err = ACAPI_Command_Call(&amp;amp;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.");
			}
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Exception thrown at 0x00007FFDEC97EA72 (DXF_DWG_Engine.dll) in Archicad.exe: 0xC0000005: Access violation reading location 0x0000000000000000.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Exception rises from&amp;nbsp; 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).&lt;BR /&gt;I know this may take a long time. Please let me know if you figure something out.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;</description>
      <pubDate>Sun, 12 Sep 2021 23:58:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Has-been-something-changed-in-DXF-DWG-add-on-since-AC24/m-p/305780#M8161</guid>
      <dc:creator>Dejmas</dc:creator>
      <dc:date>2021-09-12T23:58:46Z</dc:date>
    </item>
  </channel>
</rss>

