<?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: Upgrading code from Revit 2016 to support Revit 2018 in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7422362#M55912</link>
    <description>&lt;P&gt;Adam,&lt;/P&gt;
&lt;P&gt;If you want to have a single codebase, you can define some compilation symbols like "REVIT2016","REVIT2018". You can set symbol as picture shows&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ConditionalCompilationSymbols.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/407342i7FD7831BDC50F7E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="ConditionalCompilationSymbols.png" alt="ConditionalCompilationSymbols.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample of get a face normal in a single codebase using compilation symbol:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;XYZ normal = null;
#if REVIT2015
            normal = face.ComputeNormal(UV.Zero);
#else
            normal = face.FaceNormal;
#endif&lt;/PRE&gt;
&lt;P&gt;In that case, if you want to build different version, you only need to change the compilation symbol in project's property.&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>Sat, 30 Sep 2017 13:40:12 GMT</pubDate>
    <dc:creator>JimJia</dc:creator>
    <dc:date>2017-09-30T13:40:12Z</dc:date>
    <item>
      <title>Upgrading code from Revit 2016 to support Revit 2018</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7402220#M55908</link>
      <description>&lt;P&gt;We have an Add-In codebase running well on Revit 2015, 2016.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We wish to offer it for Revit 2018 however in the 2018 SDK I see many namespace changes, enum changes etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;What is to preferred method to support Revit 2016 and Revit 2018? &amp;nbsp;I am hoping to avoid having to build 2 different installs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Adam&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 16:59:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7402220#M55908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T16:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Upgrading code from Revit 2016 to support Revit 2018</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7411532#M55909</link>
      <description>&lt;P&gt;Each year when the new Revit releases, I test my addins by...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) copying my VS project to another location&lt;/P&gt;
&lt;P&gt;2) running a "clean solution" on the project to remove previous build files&lt;/P&gt;
&lt;P&gt;3) adding the new Revit dll&amp;nbsp;library references&lt;/P&gt;
&lt;P&gt;4) build the solution&lt;/P&gt;
&lt;P&gt;5) if there are warnings or errors, something has changed in the API&lt;/P&gt;
&lt;P&gt;6) review and adjust the errored code&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 23:45:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7411532#M55909</guid>
      <dc:creator>Troy_Gates</dc:creator>
      <dc:date>2017-09-26T23:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Upgrading code from Revit 2016 to support Revit 2018</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7411654#M55910</link>
      <description>Dear Adam,

If you want to have only one installer for Revit 2016 and 2018, you need to do some additional work. Here is a workaround way:

Build Revit 2016 and 2018 separately, and put them into installer, then modify your installer, install right version depend on user selected when installing your add-in.

By the way, if you want to only keep one copy of your add-in code, you can add some "build condition" in your code. 

Hope this workaround way can resolve your problem.</description>
      <pubDate>Wed, 27 Sep 2017 01:27:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7411654#M55910</guid>
      <dc:creator>JimJia</dc:creator>
      <dc:date>2017-09-27T01:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Upgrading code from Revit 2016 to support Revit 2018</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7419511#M55911</link>
      <description>&lt;P&gt;Sure, but then I have 2 codebases to maintain / 2 codebases to bug fix. &amp;nbsp;And when Revit 2019 comes out I have 3 code bases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm looking for is how to support multiple versions of Revit from a single codebase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 07:51:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7419511#M55911</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-29T07:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Upgrading code from Revit 2016 to support Revit 2018</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7422362#M55912</link>
      <description>&lt;P&gt;Adam,&lt;/P&gt;
&lt;P&gt;If you want to have a single codebase, you can define some compilation symbols like "REVIT2016","REVIT2018". You can set symbol as picture shows&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ConditionalCompilationSymbols.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/407342i7FD7831BDC50F7E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="ConditionalCompilationSymbols.png" alt="ConditionalCompilationSymbols.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample of get a face normal in a single codebase using compilation symbol:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;XYZ normal = null;
#if REVIT2015
            normal = face.ComputeNormal(UV.Zero);
#else
            normal = face.FaceNormal;
#endif&lt;/PRE&gt;
&lt;P&gt;In that case, if you want to build different version, you only need to change the compilation symbol in project's property.&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>Sat, 30 Sep 2017 13:40:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7422362#M55912</guid>
      <dc:creator>JimJia</dc:creator>
      <dc:date>2017-09-30T13:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Upgrading code from Revit 2016 to support Revit 2018</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7422381#M55913</link>
      <description>&lt;P&gt;It's not impossible but&amp;nbsp;I doubt you&amp;nbsp;are going to get an answer that it is supported because&amp;nbsp;the best practice is to use the version of the API relevant to the Revit version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found that you can support later versions of Revit if you use previous versions of the API and don't need the latest features. I've also found you can build&amp;nbsp;with the latest version of the API and use with previous Revit versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to test it and focus on where the interactions with the API are. You'll get missing member exceptions in some instances where you are calling something that doesn't exist in a previous version. These errors will be runtime because according to your incorrect references you are ok at design time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generally on the first year something will become obsolete but still available and the following year it is taken out. So if you wrote based on 2017 you have some confidence that the same members will still be available in 2018 but in 2019 you have to look again. I've considered taking this approach in the past but it generally isn't a huge task to update each year.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 14:08:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/upgrading-code-from-revit-2016-to-support-revit-2018/m-p/7422381#M55913</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2017-09-30T14:08:16Z</dc:date>
    </item>
  </channel>
</rss>

