<?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 ArchiCAD Add-On: Incorrectly Reporting Embedded Doors in Walls in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/ArchiCAD-Add-On-Incorrectly-Reporting-Embedded-Doors-in-Walls/m-p/581080#M9014</link>
    <description>&lt;P&gt;Hello fellow ArchiCAD developers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm currently developing an add-on for ArchiCAD and have encountered an issue that I'm struggling to resolve. The add-on's purpose is to process building elements, specifically to report the properties of walls, including any embedded doors. However, I'm facing a problem where the add-on is incorrectly reporting multiple embedded doors for a single wall, even when there's only one door embedded.&lt;/P&gt;
&lt;P&gt;Here's a brief overview of what the add-on does:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It iterates through building elements (walls, slabs, zones, doors, and dimensions).&lt;/LI&gt;
&lt;LI&gt;For each wall element, it's supposed to identify and report any embedded doors.&lt;/LI&gt;
&lt;LI&gt;The output should list each wall with its GUID and the GUIDs of any embedded doors.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Issue:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The add-on is listing multiple door GUIDs for single walls, including GUIDs that don't correspond to actual doors in the project.&lt;/LI&gt;
&lt;LI&gt;I've used the ACAPI_Element_GetMemo function to retrieve the wallDoors array from the API_ElementMemo struct, but the output contains extraneous data.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;// Handling Wall elements
if (elemType == API_WallID) {
    API_ElementMemo memo;
    BNZeroMemory(&amp;amp;memo, sizeof(API_ElementMemo));

    if (ACAPI_Element_GetMemo(elementGuid, &amp;amp;memo) == NoError) {
        std::string doorsStr;
        if (memo.wallDoors != nullptr) {
            for (int i = 0; memo.wallDoors[i] != APINULLGuid; ++i) {
                if (!doorsStr.empty()) doorsStr += ", ";
                doorsStr += APIGuidToString(memo.wallDoors[i]).ToCStr().Get();
            }
        }
        if (!doorsStr.empty()) {
            sprintf(reportStr + strlen(reportStr), " Embedded Doors: [%s]", doorsStr.c_str());
        }
    }
    ACAPI_DisposeElemMemoHdls(&amp;amp;memo);
}​&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any advice, insights, or suggestions on how to properly extract and report only the actual embedded doors for each wall would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is how my output looks like.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sercet65_0-1703032033188.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50742iCE6718DAA3DA413F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sercet65_0-1703032033188.png" alt="sercet65_0-1703032033188.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards, &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:40:56 GMT</pubDate>
    <dc:creator>sercet65</dc:creator>
    <dc:date>2024-09-16T12:40:56Z</dc:date>
    <item>
      <title>ArchiCAD Add-On: Incorrectly Reporting Embedded Doors in Walls</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ArchiCAD-Add-On-Incorrectly-Reporting-Embedded-Doors-in-Walls/m-p/581080#M9014</link>
      <description>&lt;P&gt;Hello fellow ArchiCAD developers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm currently developing an add-on for ArchiCAD and have encountered an issue that I'm struggling to resolve. The add-on's purpose is to process building elements, specifically to report the properties of walls, including any embedded doors. However, I'm facing a problem where the add-on is incorrectly reporting multiple embedded doors for a single wall, even when there's only one door embedded.&lt;/P&gt;
&lt;P&gt;Here's a brief overview of what the add-on does:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It iterates through building elements (walls, slabs, zones, doors, and dimensions).&lt;/LI&gt;
&lt;LI&gt;For each wall element, it's supposed to identify and report any embedded doors.&lt;/LI&gt;
&lt;LI&gt;The output should list each wall with its GUID and the GUIDs of any embedded doors.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Issue:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The add-on is listing multiple door GUIDs for single walls, including GUIDs that don't correspond to actual doors in the project.&lt;/LI&gt;
&lt;LI&gt;I've used the ACAPI_Element_GetMemo function to retrieve the wallDoors array from the API_ElementMemo struct, but the output contains extraneous data.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;// Handling Wall elements
if (elemType == API_WallID) {
    API_ElementMemo memo;
    BNZeroMemory(&amp;amp;memo, sizeof(API_ElementMemo));

    if (ACAPI_Element_GetMemo(elementGuid, &amp;amp;memo) == NoError) {
        std::string doorsStr;
        if (memo.wallDoors != nullptr) {
            for (int i = 0; memo.wallDoors[i] != APINULLGuid; ++i) {
                if (!doorsStr.empty()) doorsStr += ", ";
                doorsStr += APIGuidToString(memo.wallDoors[i]).ToCStr().Get();
            }
        }
        if (!doorsStr.empty()) {
            sprintf(reportStr + strlen(reportStr), " Embedded Doors: [%s]", doorsStr.c_str());
        }
    }
    ACAPI_DisposeElemMemoHdls(&amp;amp;memo);
}​&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any advice, insights, or suggestions on how to properly extract and report only the actual embedded doors for each wall would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is how my output looks like.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sercet65_0-1703032033188.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50742iCE6718DAA3DA413F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sercet65_0-1703032033188.png" alt="sercet65_0-1703032033188.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards, &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:40:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ArchiCAD-Add-On-Incorrectly-Reporting-Embedded-Doors-in-Walls/m-p/581080#M9014</guid>
      <dc:creator>sercet65</dc:creator>
      <dc:date>2024-09-16T12:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD Add-On: Incorrectly Reporting Embedded Doors in Walls</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ArchiCAD-Add-On-Incorrectly-Reporting-Embedded-Doors-in-Walls/m-p/581120#M9016</link>
      <description>&lt;P&gt;Use this code to get the correct number of guids in a memo array:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;GSSize doorCount = BMGetPtrSize (reinterpret_cast&amp;lt;GSPtr&amp;gt; (memo-&amp;gt;wallDoors)) / sizeof (API_Guid);
for (GSSize i = 0; i &amp;lt; doorCount; i++) {
    const API_Guid&amp;amp; doorGuid = memo-&amp;gt;wallDoors[i];
    // do something with the door
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 05:44:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ArchiCAD-Add-On-Incorrectly-Reporting-Embedded-Doors-in-Walls/m-p/581120#M9016</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2023-12-20T05:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD Add-On: Incorrectly Reporting Embedded Doors in Walls</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ArchiCAD-Add-On-Incorrectly-Reporting-Embedded-Doors-in-Walls/m-p/581269#M9027</link>
      <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12765"&gt;@Viktor Kovacs&lt;/a&gt;&amp;nbsp;Thank you very much for the feedback. That was very helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 22:47:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ArchiCAD-Add-On-Incorrectly-Reporting-Embedded-Doors-in-Walls/m-p/581269#M9027</guid>
      <dc:creator>sercet65</dc:creator>
      <dc:date>2023-12-20T22:47:32Z</dc:date>
    </item>
  </channel>
</rss>

