<?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 Building an addon for different AC versions in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Building-an-addon-for-different-AC-versions/m-p/309523#M1835</link>
    <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I made a small open source add-on for synchronizing properties and parameters of GDL objects.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;It works in version 24, but I would like to release an add-on for other versions.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;What is the best way to organize the assembly and testing of an add-on for different versions of Archicad (provided that the code is compatible with other versions)?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Oct 2021 19:33:47 GMT</pubDate>
    <dc:creator>kuvbur</dc:creator>
    <dc:date>2021-10-17T19:33:47Z</dc:date>
    <item>
      <title>Building an addon for different AC versions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Building-an-addon-for-different-AC-versions/m-p/309523#M1835</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I made a small open source add-on for synchronizing properties and parameters of GDL objects.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;It works in version 24, but I would like to release an add-on for other versions.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;What is the best way to organize the assembly and testing of an add-on for different versions of Archicad (provided that the code is compatible with other versions)?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2021 19:33:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Building-an-addon-for-different-AC-versions/m-p/309523#M1835</guid>
      <dc:creator>kuvbur</dc:creator>
      <dc:date>2021-10-17T19:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Building an addon for different AC versions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Building-an-addon-for-different-AC-versions/m-p/309554#M1836</link>
      <description>&lt;P&gt;Archicad API is relatively stable, but sometimes there are changes that won't compile with a newer version of the Development Kit. The question here is how to handle this situation.&lt;/P&gt;
&lt;P&gt;There are two ways:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Keep a separate source for different versions (like a GitHub branch for all versions). In this case you don't have to deal with version-specific codes, but on the other hand you have to maintain the rest of the the code in multiple places.&lt;/LI&gt;
&lt;LI&gt;Use one source code for both versions. In this case it is easier to handle the code, but on the other hand you have to deal with different versions in the same code.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The selected solution depends on your code. If you have relatively small codebase the second one is recommended. You can have compiler flags to determine the version of base Archicad, so you can write something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#if defined (ServerMainVers_2500)
	using MemoryIChannel = GS::MemoryIChannel;
	using MemoryOChannel = GS::MemoryOChannel;
#else
	using MemoryIChannel = IO::MemoryIChannel;
	using MemoryOChannel = IO::MemoryOChannel;
#endif&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void SetAPIElementType (API_Element&amp;amp; element, API_ElemTypeID elemTypeId)
{
#ifdef ServerMainVers_2600
	element.header.type = API_ElemType (elemTypeId);
#else
	element.header.typeID = elemTypeId;
#endif
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how the &lt;A href="https://github.com/GRAPHISOFT/Archicad-maze-generator" target="_self"&gt;Maze Generator Add-On&lt;/A&gt; is implemented.&lt;/P&gt;
&lt;P&gt;From the build point of view I would generate projects with cmake to different folders inside the Build folder (like &lt;FONT face="courier new,courier"&gt;Build/AC24&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;Build/AC25&lt;/FONT&gt;). With this solution you will have separate projects for the same code base.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 17:32:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Building-an-addon-for-different-AC-versions/m-p/309554#M1836</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2021-10-19T17:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Building an addon for different AC versions</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Building-an-addon-for-different-AC-versions/m-p/309787#M1837</link>
      <description>&lt;P&gt;We use #2 on the recommended solution. We started on AC18 and currently AC25. But we currently supporting AC21 above (since our current projects use these versions). Whenever new AC version is/will be released, we made sure that the add-ons that we have will be compatible to that new version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If ever you will be supporting lower version of AC (below 24 in your op), I recommend you to start to the lowest version first, then go up to the latest version. When we have new add-on, we define which AC versions will be supported, and start coding to the lowest version. After completing the add-on (or even one functionality of it), we start migrating to the next version and change anything that might conflict to the newer version (renamed functions, new functions, removed/obsolete functions, etc.).&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 02:45:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Building-an-addon-for-different-AC-versions/m-p/309787#M1837</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2021-10-20T02:45:26Z</dc:date>
    </item>
  </channel>
</rss>

