<?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 Changing elements in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571627#M8757</link>
    <description>&lt;P&gt;Hello! I've been struggling to make things work here.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The code builds, the command runs without trouble and I get the dialog at the end. But I get no changes to my element. can't figure out what's still missing. I've used most of the code from the examples.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I'm not using&amp;nbsp;'ACAPI_Element_Edit', cause I warns that:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No matching function for call to 'ACAPI_Element_Edit'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;#include &lt;/SPAN&gt;"basicgeometry.h"&lt;/P&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;LI-CODE lang="cpp"&gt;void EditWall ()
{
    API_Element            element, mask;
    API_ElementMemo        memo;
//    GSErrCode err = NoError;
    
    element = {};
    memo = {};
    
    ACAPI_Element_Get (&amp;amp;element);
    ACAPI_Element_GetMemo (element.header.guid, &amp;amp;memo);
    
    ACAPI_ELEMENT_MASK_CLEAR (mask);
    ACAPI_ELEMENT_MASK_SET (mask, API_WallType, thickness);
    element.wall.thickness = 1.0;
    
//    ACAPI_Element_Edit(&amp;amp;element, &amp;amp;mask);

    ACAPI_Element_Change (&amp;amp;element, &amp;amp;mask, &amp;amp;memo, 0, true);
    
    DG::InformationAlert ("Exit", "Click ok to continue", "OK");
}&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:29:05 GMT</pubDate>
    <dc:creator>vdentello</dc:creator>
    <dc:date>2024-09-16T12:29:05Z</dc:date>
    <item>
      <title>Changing elements</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571627#M8757</link>
      <description>&lt;P&gt;Hello! I've been struggling to make things work here.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The code builds, the command runs without trouble and I get the dialog at the end. But I get no changes to my element. can't figure out what's still missing. I've used most of the code from the examples.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I'm not using&amp;nbsp;'ACAPI_Element_Edit', cause I warns that:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No matching function for call to 'ACAPI_Element_Edit'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;#include &lt;/SPAN&gt;"basicgeometry.h"&lt;/P&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;LI-CODE lang="cpp"&gt;void EditWall ()
{
    API_Element            element, mask;
    API_ElementMemo        memo;
//    GSErrCode err = NoError;
    
    element = {};
    memo = {};
    
    ACAPI_Element_Get (&amp;amp;element);
    ACAPI_Element_GetMemo (element.header.guid, &amp;amp;memo);
    
    ACAPI_ELEMENT_MASK_CLEAR (mask);
    ACAPI_ELEMENT_MASK_SET (mask, API_WallType, thickness);
    element.wall.thickness = 1.0;
    
//    ACAPI_Element_Edit(&amp;amp;element, &amp;amp;mask);

    ACAPI_Element_Change (&amp;amp;element, &amp;amp;mask, &amp;amp;memo, 0, true);
    
    DG::InformationAlert ("Exit", "Click ok to continue", "OK");
}&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:29:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571627#M8757</guid>
      <dc:creator>vdentello</dc:creator>
      <dc:date>2024-09-16T12:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Changing elements</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571759#M8764</link>
      <description>&lt;P&gt;Hi Vítor,&lt;BR /&gt;&lt;BR /&gt;The &lt;STRONG&gt;element.header.guid&lt;/STRONG&gt; is empty since you didn't assign anything. &lt;BR /&gt;So both &lt;STRONG&gt;ACAPI_Element_Get&lt;/STRONG&gt; and &lt;STRONG&gt;ACAPI_Element_GetMemo&lt;/STRONG&gt; won't know which element to look for.&lt;BR /&gt;You'll have to get a guid of a wall first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a lot of possibilities for this.&lt;/P&gt;
&lt;P&gt;E.g. iterate through all walls with &lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#gad0a3cc26ebbcb18613c2d3df01eb7384" target="_blank"&gt;ACAPI_Element_GetElemList&lt;/A&gt; or get the guid from a selection with &lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___selection.html#ga1301c5bcb61d90998c0b1f97f5c82544" target="_blank"&gt;ACAPI_Selection_Get&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There's a good code example for it on the linked documentation page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The rest of your code seems fine for changing the wall thickness.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you want to use &lt;STRONG&gt;ACAPI_Element_Edit&lt;/STRONG&gt; you will have to pass different arguments as documented here: &lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___element.html#gaf661e412a0e3a3f6979444c67ec6d7f0" target="_blank"&gt;https://graphisoft.github.io/archicad-api-devkit/group___element.html#gaf661e412a0e3a3f6979444c67ec6d7f0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 06:28:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571759#M8764</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-10-20T06:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing elements</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571917#M8768</link>
      <description>&lt;P&gt;It finally worked!&lt;BR /&gt;Another very important detail that was missing, from the beginning, was that it needs a&amp;nbsp;ACAPI_CallUndoableCommand before everything, followed by a&amp;nbsp;ACAPI_DisposeElemMemoHdls as it seems. Found many occurrences of this issue in the forum. I guess that should be more explicit within the first steps.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 18:36:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571917#M8768</guid>
      <dc:creator>vdentello</dc:creator>
      <dc:date>2023-10-20T18:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Changing elements</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571930#M8769</link>
      <description>&lt;P&gt;Another point -- for cleaner code: API_ElementMemo&amp;nbsp; is not required and should be replaced with nullptr. It's only required if your going to replace some of the attributes in the Memo structure.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 21:18:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Changing-elements/m-p/571930#M8769</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-10-20T21:18:06Z</dc:date>
    </item>
  </channel>
</rss>

