<?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 Crash upon opening a file (File &amp;gt; Open) after executing DWG export via Add-On API (AC27 – AC30) in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Crash-upon-opening-a-file-File-gt-Open-after-executing-DWG/m-p/717887#M11071</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I would like to ask for advice or assistance regarding a crash issue when exporting DWG files via an add-on.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Overview:&lt;/STRONG&gt; This issue was first observed in &lt;STRONG&gt;Archicad 27 Japanese edition&lt;/STRONG&gt; and still persists up to &lt;STRONG&gt;Archicad 30 Japanese edition&lt;/STRONG&gt;. When we reported this issue previously through direct support, we were informed that it was recognized as a bug and scheduled to be fixed based on priority. However, as it remains unfixed, many features in our add-on execute up to Step 4 below, which causes Archicad to crash deterministically in certain workflows. This is causing significant issues for our users.&lt;/P&gt;&lt;H3&gt;Steps to Reproduce&lt;/H3&gt;&lt;P&gt;&lt;I&gt;(Note: These steps were recorded on AC27, but the behavior appears to remain the same in recent versions.)&lt;/I&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Launch Archicad 27 with a new/empty project. Switch the view to &lt;STRONG&gt;3D Perspective&lt;/STRONG&gt;, create a single box Morph, and save the project as a .pln file while remaining in the 3D Perspective view. Close Archicad.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;In the API Development Kit Example projects, open Communication_Manager and replace the target function with the source code provided below, then build the add-on.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Launch Archicad 27 and open the .pln file saved in Step 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Execute the menu command &lt;STRONG&gt;Test &amp;gt; Communication_Manager &amp;gt; Save External Files as DWG&lt;/STRONG&gt; (created in Step 2). Confirm that a 3D DWG file is generated successfully in your Documents folder.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Go to &lt;STRONG&gt;File &amp;gt; Open&lt;/STRONG&gt; and load the .pln file from Step 1 (or any other .pln file).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Once the file opens in 3D Perspective view, move the mouse cursor into the main view area. Archicad crashes immediately.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;static void Do_CallExternalSaveAsDWG(void)
{
    API_ModulID        mdid = { 1198731108, 1322668197 };        // DXF/DWG add-on
    API_MDCLParameter  par;
    GSHandle           parHdl;
    GSErrCode          err;
    IO::Location       configFile;

    // Change 3D View
    API_WindowInfo     windInfo;
    BNZeroMemory(&amp;amp;windInfo, sizeof(windInfo));
    windInfo.typeID = APIWind_3DModelID;
    err = ACAPI_Window_ChangeWindow(reinterpret_cast&amp;lt;const API_WindowInfo*&amp;gt; (&amp;amp;windInfo));

    // Local call DWG add-on to retrieve the default translator
    err = ACAPI_AddOnAddOnCommunication_InitMDCLParameterList(&amp;amp;parHdl);
    if (err != NoError)
        return;

    par = {};
    par.name = "Mode";
    par.type = MDCLPar_string;
    par.string_par = "Default";
    err = ACAPI_AddOnAddOnCommunication_AddMDCLParameter(parHdl, &amp;amp;par);
    IO::Location loc;
    if (err == NoError) {
        err = ACAPI_AddOnAddOnCommunication_Call(&amp;amp;mdid, 'GDCO', 1, parHdl, (GSPtr)&amp;amp;loc, false);    // Get default translator
    }

    if (err == NoError)
        configFile.Set(loc.ToDisplayText());

    ACAPI_AddOnAddOnCommunication_FreeMDCLParameterList(&amp;amp;parHdl);

    if (!configFile.IsLegalInNativeFileSystem())
        return;

    IO::Location outputLoc;
    API_SpecFolderID specID = API_UserDocumentsFolderID;
    ACAPI_ProjectSettings_GetSpecFolder(&amp;amp;specID, &amp;amp;(outputLoc));
    outputLoc.AppendToLocal(IO::Name("TestOut.DWG"));

    err = ACAPI_AddOnAddOnCommunication_InitMDCLParameterList(&amp;amp;parHdl);
    if (err != NoError) return;

    char    str[512];
    IO::URL url;
    BNZeroMemory(&amp;amp;par, sizeof(par));
    par.name = "FileName";
    par.type = MDCLPar_string;
    outputLoc.ToURL(&amp;amp;url);
    CHTruncate((const char*)url, str, sizeof(str));
    par.string_par = str;
    err = ACAPI_AddOnAddOnCommunication_AddMDCLParameter(parHdl, &amp;amp;par);

    if (err != NoError) return;
    BNZeroMemory(&amp;amp;par, sizeof(par));
    par.name = "ConfigFile";
    par.type = MDCLPar_string;
    configFile.ToURL(&amp;amp;url);
    CHTruncate((const char*)url, str, sizeof(str));
    par.string_par = str;
    err = ACAPI_AddOnAddOnCommunication_AddMDCLParameter(parHdl, &amp;amp;par);

    if (err != NoError) return;

    err = ACAPI_AddOnAddOnCommunication_Call(&amp;amp;mdid, 'SAV3', 1, parHdl, NULL, true);

    if (err != NoError) return;

    ACAPI_AddOnAddOnCommunication_FreeMDCLParameterList(&amp;amp;parHdl);

    return;
}&lt;/LI-CODE&gt;&lt;P&gt;Has anyone encountered a similar behavior or found a workaround/bypass for this issue? Any insights or suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="grey"&gt;Operating system used: &lt;EM&gt;Windows 11 25H2&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Oct 2026 06:08:25 GMT</pubDate>
    <dc:creator>NH</dc:creator>
    <dc:date>2026-10-16T06:08:25Z</dc:date>
    <item>
      <title>Crash upon opening a file (File &gt; Open) after executing DWG export via Add-On API (AC27 – AC30)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Crash-upon-opening-a-file-File-gt-Open-after-executing-DWG/m-p/717887#M11071</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I would like to ask for advice or assistance regarding a crash issue when exporting DWG files via an add-on.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Overview:&lt;/STRONG&gt; This issue was first observed in &lt;STRONG&gt;Archicad 27 Japanese edition&lt;/STRONG&gt; and still persists up to &lt;STRONG&gt;Archicad 30 Japanese edition&lt;/STRONG&gt;. When we reported this issue previously through direct support, we were informed that it was recognized as a bug and scheduled to be fixed based on priority. However, as it remains unfixed, many features in our add-on execute up to Step 4 below, which causes Archicad to crash deterministically in certain workflows. This is causing significant issues for our users.&lt;/P&gt;&lt;H3&gt;Steps to Reproduce&lt;/H3&gt;&lt;P&gt;&lt;I&gt;(Note: These steps were recorded on AC27, but the behavior appears to remain the same in recent versions.)&lt;/I&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Launch Archicad 27 with a new/empty project. Switch the view to &lt;STRONG&gt;3D Perspective&lt;/STRONG&gt;, create a single box Morph, and save the project as a .pln file while remaining in the 3D Perspective view. Close Archicad.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;In the API Development Kit Example projects, open Communication_Manager and replace the target function with the source code provided below, then build the add-on.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Launch Archicad 27 and open the .pln file saved in Step 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Execute the menu command &lt;STRONG&gt;Test &amp;gt; Communication_Manager &amp;gt; Save External Files as DWG&lt;/STRONG&gt; (created in Step 2). Confirm that a 3D DWG file is generated successfully in your Documents folder.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Go to &lt;STRONG&gt;File &amp;gt; Open&lt;/STRONG&gt; and load the .pln file from Step 1 (or any other .pln file).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Once the file opens in 3D Perspective view, move the mouse cursor into the main view area. Archicad crashes immediately.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;static void Do_CallExternalSaveAsDWG(void)
{
    API_ModulID        mdid = { 1198731108, 1322668197 };        // DXF/DWG add-on
    API_MDCLParameter  par;
    GSHandle           parHdl;
    GSErrCode          err;
    IO::Location       configFile;

    // Change 3D View
    API_WindowInfo     windInfo;
    BNZeroMemory(&amp;amp;windInfo, sizeof(windInfo));
    windInfo.typeID = APIWind_3DModelID;
    err = ACAPI_Window_ChangeWindow(reinterpret_cast&amp;lt;const API_WindowInfo*&amp;gt; (&amp;amp;windInfo));

    // Local call DWG add-on to retrieve the default translator
    err = ACAPI_AddOnAddOnCommunication_InitMDCLParameterList(&amp;amp;parHdl);
    if (err != NoError)
        return;

    par = {};
    par.name = "Mode";
    par.type = MDCLPar_string;
    par.string_par = "Default";
    err = ACAPI_AddOnAddOnCommunication_AddMDCLParameter(parHdl, &amp;amp;par);
    IO::Location loc;
    if (err == NoError) {
        err = ACAPI_AddOnAddOnCommunication_Call(&amp;amp;mdid, 'GDCO', 1, parHdl, (GSPtr)&amp;amp;loc, false);    // Get default translator
    }

    if (err == NoError)
        configFile.Set(loc.ToDisplayText());

    ACAPI_AddOnAddOnCommunication_FreeMDCLParameterList(&amp;amp;parHdl);

    if (!configFile.IsLegalInNativeFileSystem())
        return;

    IO::Location outputLoc;
    API_SpecFolderID specID = API_UserDocumentsFolderID;
    ACAPI_ProjectSettings_GetSpecFolder(&amp;amp;specID, &amp;amp;(outputLoc));
    outputLoc.AppendToLocal(IO::Name("TestOut.DWG"));

    err = ACAPI_AddOnAddOnCommunication_InitMDCLParameterList(&amp;amp;parHdl);
    if (err != NoError) return;

    char    str[512];
    IO::URL url;
    BNZeroMemory(&amp;amp;par, sizeof(par));
    par.name = "FileName";
    par.type = MDCLPar_string;
    outputLoc.ToURL(&amp;amp;url);
    CHTruncate((const char*)url, str, sizeof(str));
    par.string_par = str;
    err = ACAPI_AddOnAddOnCommunication_AddMDCLParameter(parHdl, &amp;amp;par);

    if (err != NoError) return;
    BNZeroMemory(&amp;amp;par, sizeof(par));
    par.name = "ConfigFile";
    par.type = MDCLPar_string;
    configFile.ToURL(&amp;amp;url);
    CHTruncate((const char*)url, str, sizeof(str));
    par.string_par = str;
    err = ACAPI_AddOnAddOnCommunication_AddMDCLParameter(parHdl, &amp;amp;par);

    if (err != NoError) return;

    err = ACAPI_AddOnAddOnCommunication_Call(&amp;amp;mdid, 'SAV3', 1, parHdl, NULL, true);

    if (err != NoError) return;

    ACAPI_AddOnAddOnCommunication_FreeMDCLParameterList(&amp;amp;parHdl);

    return;
}&lt;/LI-CODE&gt;&lt;P&gt;Has anyone encountered a similar behavior or found a workaround/bypass for this issue? Any insights or suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="grey"&gt;Operating system used: &lt;EM&gt;Windows 11 25H2&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2026 06:08:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Crash-upon-opening-a-file-File-gt-Open-after-executing-DWG/m-p/717887#M11071</guid>
      <dc:creator>NH</dc:creator>
      <dc:date>2026-10-16T06:08:25Z</dc:date>
    </item>
  </channel>
</rss>

