<?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 Re: Create and then undo several elements together in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-then-undo-several-elements-together/m-p/574605#M8840</link>
    <description>&lt;P&gt;When you do modifications in Archicad you always need to wrap your changes in a&amp;nbsp;&lt;STRONG&gt;ACAPI_CallUndoableCommand&lt;/STRONG&gt; call. Everything happens inside the call will be undo-ed in one step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code should be something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ACAPI_CallUndoableCommand ("Create Walls", [&amp;amp;] () -&amp;gt; GSErrCode {
     // create as many walls as you need
     return NoError;
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 10:20:39 GMT</pubDate>
    <dc:creator>Viktor Kovacs</dc:creator>
    <dc:date>2023-11-08T10:20:39Z</dc:date>
    <item>
      <title>Create and then undo several elements together</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-then-undo-several-elements-together/m-p/574604#M8839</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I create several elements using the ACAPI_Element_Create function in a "for" loop. After that, I'm trying to undo it (using ctrl+z) and right now it undo each element one by one (For example, if I create ten elements in my function and I want to undo it, I have to press ctrl+z ten times).&lt;/P&gt;
&lt;P&gt;I'm wondering if there is a way so I can ctrl+z all the elements that I just created all together by using ctrl+z ONE time?&lt;/P&gt;
&lt;P&gt;I did try to use the&amp;nbsp;ACAPI_Database_StartClippingSession() function before the "for" loop and then use the&amp;nbsp;ACAPI_Database_StopClippingSession() function at the end of the "for" loop, but it didn't&amp;nbsp;work&amp;nbsp;for&amp;nbsp;me&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Windows 11, Visual Studio 2022, ArchiCAD&amp;nbsp;27,&amp;nbsp; C++&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:38:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-then-undo-several-elements-together/m-p/574604#M8839</guid>
      <dc:creator>yahavsa</dc:creator>
      <dc:date>2024-09-16T12:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create and then undo several elements together</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-then-undo-several-elements-together/m-p/574605#M8840</link>
      <description>&lt;P&gt;When you do modifications in Archicad you always need to wrap your changes in a&amp;nbsp;&lt;STRONG&gt;ACAPI_CallUndoableCommand&lt;/STRONG&gt; call. Everything happens inside the call will be undo-ed in one step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code should be something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ACAPI_CallUndoableCommand ("Create Walls", [&amp;amp;] () -&amp;gt; GSErrCode {
     // create as many walls as you need
     return NoError;
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 10:20:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-then-undo-several-elements-together/m-p/574605#M8840</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2023-11-08T10:20:39Z</dc:date>
    </item>
  </channel>
</rss>

