<?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: autocad app version references in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8513607#M23840</link>
    <description>&lt;P&gt;You can use the same code base to build two separate dlls using conditional compliation as I showed above.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jan 2019 16:25:46 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2019-01-10T16:25:46Z</dc:date>
    <item>
      <title>autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8510980#M23830</link>
      <description>&lt;P&gt;I have installed on my machine both Map 3D and Civil 3D.&lt;/P&gt;
&lt;P&gt;I have created a dll that i want to run it in both.&lt;/P&gt;
&lt;P&gt;I want to avoid creating 2 separate dlls - one for map one for civil.&lt;/P&gt;
&lt;P&gt;The command basically is selecting an entity and reads the property of it.&lt;/P&gt;
&lt;P&gt;The type of entity&amp;nbsp;is either a polyline or a civil3d alignment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so if i load the dll in map 3D i want to ignore code about the civil 3D alignment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in order to do that i have to detect what autocad i am into.&lt;/P&gt;
&lt;P&gt;also if is map 3D i need to drop civil 3d references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can someone help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; Autodesk.AutoCAD.EditorInput.PromptEntityResult cl_res;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; Autodesk.AutoCAD.EditorInput.PromptEntityOptions cl_prompt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt = new Autodesk.AutoCAD.EditorInput.PromptEntityOptions("\nSelect the centerline:");&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.SetRejectMessage("\nSelect a polyline!");&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AllowNone = true;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AddAllowedClass(typeof(Autodesk.AutoCAD.DatabaseServices.Polyline), false);&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.Alignment), false);&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 18:27:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8510980#M23830</guid>
      <dc:creator>dan.popescu9NZJ8</dc:creator>
      <dc:date>2019-01-09T18:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511431#M23831</link>
      <description>&lt;P&gt;Doing that is somewhere between very difficult and impossible.&amp;nbsp; It would require you to eliminate 'hard' references to types in the C3D libraries, and load them dynamically and call methods via reflection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Building two separate DLLs is really your only practical option. You can use a single code base that uses conditional compilation (#ifdef/#endif) to factor out all C3D-dependent code for the build that targets Map3D.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cl_prompt.AddAllowedClass(typeof(Autodesk.AutoCAD.DatabaseServices.Polyline), false);
#ifdef CIVIL3D
cl_prompt.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.Alignment), false);
#endif
 &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4167085"&gt;@dan.popescu9NZJ8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have installed on my machine both Map 3D and Civil 3D.&lt;/P&gt;
&lt;P&gt;I have created a dll that i want to run it in both.&lt;/P&gt;
&lt;P&gt;I want to avoid creating 2 separate dlls - one for map one for civil.&lt;/P&gt;
&lt;P&gt;The command basically is selecting an entity and reads the property of it.&lt;/P&gt;
&lt;P&gt;The type of entity&amp;nbsp;is either a polyline or a civil3d alignment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so if i load the dll in map 3D i want to ignore code about the civil 3D alignment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in order to do that i have to detect what autocad i am into.&lt;/P&gt;
&lt;P&gt;also if is map 3D i need to drop civil 3d references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can someone help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; Autodesk.AutoCAD.EditorInput.PromptEntityResult cl_res;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; Autodesk.AutoCAD.EditorInput.PromptEntityOptions cl_prompt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt = new Autodesk.AutoCAD.EditorInput.PromptEntityOptions("\nSelect the centerline:");&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.SetRejectMessage("\nSelect a polyline!");&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AllowNone = true;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AddAllowedClass(typeof(Autodesk.AutoCAD.DatabaseServices.Polyline), false);&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde" size="2" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.Alignment), false);&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 20:43:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511431#M23831</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2019-01-09T20:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511473#M23832</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4167085"&gt;@dan.popescu9NZJ8&lt;/a&gt;&amp;nbsp; написал (-а):&lt;BR /&gt;
&lt;P&gt;I have installed on my machine both Map 3D and Civil 3D.&lt;/P&gt;
&lt;P&gt;I have created a dll that i want to run it in both.&lt;/P&gt;
&lt;P&gt;I want to avoid creating 2 separate dlls - one for map one for civil.&lt;/P&gt;
&lt;P&gt;The command basically is selecting an entity and reads the property of it.&lt;/P&gt;
&lt;P&gt;The type of entity&amp;nbsp;is either a polyline or a civil3d alignment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so if i load the dll in map 3D i want to ignore code about the civil 3D alignment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in order to do that i have to detect what autocad i am into.&lt;/P&gt;
&lt;P&gt;also if is map 3D i need to drop civil 3d references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can someone help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2" face="arial black,avant garde" color="#0000FF"&gt;&lt;EM&gt; Autodesk.AutoCAD.EditorInput.PromptEntityResult cl_res;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="arial black,avant garde" color="#0000FF"&gt;&lt;EM&gt; Autodesk.AutoCAD.EditorInput.PromptEntityOptions cl_prompt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="arial black,avant garde" color="#0000FF"&gt;&lt;EM&gt; cl_prompt = new Autodesk.AutoCAD.EditorInput.PromptEntityOptions("\nSelect the centerline:");&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="arial black,avant garde" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.SetRejectMessage("\nSelect a polyline!");&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="arial black,avant garde" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AllowNone = true;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="arial black,avant garde" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AddAllowedClass(typeof(Autodesk.AutoCAD.DatabaseServices.Polyline), false);&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" face="arial black,avant garde" color="#0000FF"&gt;&lt;EM&gt; cl_prompt.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.Alignment), false);&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;IMHO. It is easy split your dll into two - dll1 for AutoCAD, and dll2 for Civil 3D. If dll1 detect that it was loaded in Civil3d it loaded dll2 and call it's methodes. In other case you have to use Civil 3D API with help of reflection - it is not easy.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 20:51:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511473#M23832</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-01-09T20:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511494#M23833</link>
      <description>&lt;P&gt;Thank you for your answer.... how do I detect if is&amp;nbsp;autocad map over autocad civil 3d?&lt;/P&gt;
&lt;P&gt;I got over the internet some code:&lt;/P&gt;
&lt;P&gt;but when i am running it in autocad map is giving me as being civil&lt;/P&gt;
&lt;PRE&gt; private static bool is_civil3d()
        {
            dynamic acadApp;
            try
            {
                acadApp = System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application");
            }
            catch
            {
                return false;
            }

            string acVer = acadApp.Version.Substring(0, 4);


            string aeccVer;

            if (acVer == "19.0")
                aeccVer = "10.0";
            else if (acVer == "19.1")
                aeccVer = "10.3";
            else if (acVer == "20.0")
                aeccVer = "10.4";
            else if (acVer == "20.1")
                aeccVer = "10.5";
            else if (acVer == "21.0") // acad 2017
                aeccVer = "11.0";
            else if (acVer == "22.0") //acad 2018
                aeccVer = "12.0";
            else if (acVer == "23.0") // acad 2019
                aeccVer = "13.0";
            else aeccVer = null;

            if (string.IsNullOrEmpty(aeccVer))
            {
                return false;
            }

            // Civil 3D?
            dynamic civilLandApp;
            try
            {
                civilLandApp = acadApp.GetInterfaceObject("AeccXUiLand.AeccApplication." + aeccVer);
                System.Windows.Forms.MessageBox.Show(string.Format("{0}", civilLandApp.Name));
                return true;
            }
            catch
            {

                return false;
            }

        }&lt;/PRE&gt;
&lt;P&gt;and :&lt;/P&gt;
&lt;PRE&gt;        private static string GetAcadCurVerKey()
        {
            StringBuilder sb = new StringBuilder(@"Software\Autodesk\AutoCAD\");
            using (RegistryKey acad = Registry.CurrentUser.OpenSubKey(sb.ToString()))
            {
                sb.Append(acad.GetValue("CurVer")).Append(@"\");
                using (RegistryKey curVer = Registry.CurrentUser.OpenSubKey(sb.ToString()))
                {
                    return sb.Append(curVer.GetValue("CurVer")).ToString();
                }
            }
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 20:58:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511494#M23833</guid>
      <dc:creator>dan.popescu9NZJ8</dc:creator>
      <dc:date>2019-01-09T20:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511528#M23834</link>
      <description>&lt;P&gt;The PRODUCT system variable should tell you what you're running in, but that isn't really going to help you to avoid having the runtime try to load the Civil3D API (which will fail when running on Map3D), because you can't use simple conditional branching to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4167085"&gt;@dan.popescu9NZJ8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your answer.... how do I detect if is&amp;nbsp;autocad map over autocad civil 3d?&lt;/P&gt;
&lt;P&gt;I got over the internet some code:&lt;/P&gt;
&lt;P&gt;but when i am running it in autocad map is giving me as being civil&lt;/P&gt;
&lt;PRE&gt; private static bool is_civil3d()
        {
            dynamic acadApp;
            try
            {
                acadApp = System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application");
            }
            catch
            {
                return false;
            }

            string acVer = acadApp.Version.Substring(0, 4);


            string aeccVer;

            if (acVer == "19.0")
                aeccVer = "10.0";
            else if (acVer == "19.1")
                aeccVer = "10.3";
            else if (acVer == "20.0")
                aeccVer = "10.4";
            else if (acVer == "20.1")
                aeccVer = "10.5";
            else if (acVer == "21.0") // acad 2017
                aeccVer = "11.0";
            else if (acVer == "22.0") //acad 2018
                aeccVer = "12.0";
            else if (acVer == "23.0") // acad 2019
                aeccVer = "13.0";
            else aeccVer = null;

            if (string.IsNullOrEmpty(aeccVer))
            {
                return false;
            }

            // Civil 3D?
            dynamic civilLandApp;
            try
            {
                civilLandApp = acadApp.GetInterfaceObject("AeccXUiLand.AeccApplication." + aeccVer);
                System.Windows.Forms.MessageBox.Show(string.Format("{0}", civilLandApp.Name));
                return true;
            }
            catch
            {

                return false;
            }

        }&lt;/PRE&gt;
&lt;P&gt;and :&lt;/P&gt;
&lt;PRE&gt;        private static string GetAcadCurVerKey()
        {
            StringBuilder sb = new StringBuilder(@"Software\Autodesk\AutoCAD\");
            using (RegistryKey acad = Registry.CurrentUser.OpenSubKey(sb.ToString()))
            {
                sb.Append(acad.GetValue("CurVer")).Append(@"\");
                using (RegistryKey curVer = Registry.CurrentUser.OpenSubKey(sb.ToString()))
                {
                    return sb.Append(curVer.GetValue("CurVer")).ToString();
                }
            }
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&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>Wed, 09 Jan 2019 21:07:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511528#M23834</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2019-01-09T21:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511561#M23835</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4167085"&gt;@dan.popescu9NZJ8&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;You can check if AppDomain.CurrentDomain.GetAssemblies() has "&lt;SPAN style="color: #008000;"&gt;AeccDbMgd&lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;&lt;FONT color="#000000"&gt;" or try to load "AeccDbMgd.dll" with&amp;nbsp;Assembly.LoadFile (in try/catch block).&lt;/FONT&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV id="s3gt_translate_tooltip_mini" class="s3gt_translate_tooltip_mini_box" style="background: initial !important; border: initial !important; border-radius: initial !important; border-spacing: initial !important; border-collapse: initial !important; direction: ltr !important; flex-direction: initial !important; font-weight: initial !important; height: initial !important; letter-spacing: initial !important; min-width: initial !important; max-width: initial !important; min-height: initial !important; max-height: initial !important; margin: auto !important; outline: initial !important; padding: initial !important; position: absolute; table-layout: initial !important; text-align: initial !important; text-shadow: initial !important; width: initial !important; word-break: initial !important; word-spacing: initial !important; overflow-wrap: initial !important; box-sizing: initial !important; display: initial !important; color: inherit !important; font-size: 13px !important; font-family: X-LocaleSpecific, sans-serif, Tahoma, Helvetica !important; line-height: 13px !important; vertical-align: top !important; white-space: inherit !important; left: 228px; top: 38px;"&gt;
&lt;DIV id="s3gt_translate_tooltip_mini_logo" class="s3gt_translate_tooltip_mini" title="Перевести выделенный фрагмент"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="s3gt_translate_tooltip_mini_sound" class="s3gt_translate_tooltip_mini" title="Прослушать"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="s3gt_translate_tooltip_mini_copy" class="s3gt_translate_tooltip_mini" title="Скопировать текст в буфер обмена"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Jan 2019 21:17:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511561#M23835</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-01-09T21:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511693#M23836</link>
      <description>&lt;P&gt;thans ... worked&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;            System.Reflection.Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
            bool is_civil = false;
            foreach (System.Reflection.Assembly asm in assemblies)
            {
                System.Reflection.AssemblyName asmName = asm.GetName();
                if (asmName.Name == "AeccDbMgd")
                {
                    is_civil = true;
                }

                //FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location);

                //string name = asmName.Name;
                //Version asmV = asmName.Version;
                //string fileV = fvi.FileVersion;
                //string prodV = fvi.ProductVersion;

            }&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jan 2019 22:19:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8511693#M23836</guid>
      <dc:creator>dan.popescu9NZJ8</dc:creator>
      <dc:date>2019-01-09T22:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8512048#M23837</link>
      <description>&lt;P&gt;It seems that you didn't understand what I was trying to get across to you earlier. Knowing if you're running on Civil3D isn't going to help you because if you're not running on Civil3D your code &lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="ms pmincho,hiragino mincho pron"&gt;cannot contain any references to any&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT face="ms pmincho,hiragino mincho pron"&gt;Civil3D types&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;, regardless of whether the code executes, or not.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4167085"&gt;@dan.popescu9NZJ8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;thans ... worked&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;            System.Reflection.Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
            bool is_civil = false;
            foreach (System.Reflection.Assembly asm in assemblies)
            {
                System.Reflection.AssemblyName asmName = asm.GetName();
                if (asmName.Name == "AeccDbMgd")
                {
                    is_civil = true;
                }

                //FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location);

                //string name = asmName.Name;
                //Version asmV = asmName.Version;
                //string fileV = fvi.FileVersion;
                //string prodV = fvi.ProductVersion;

            }&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 04:04:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8512048#M23837</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2019-01-10T04:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8512195#M23838</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I think&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4167085"&gt;@dan.popescu9NZJ8&lt;/a&gt; decided to split his application into two, as I suggested above.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 06:45:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8512195#M23838</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-01-10T06:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8512987#M23839</link>
      <description>&lt;P&gt;i'm not sure what path I will use... anyway the computers i am building this for should have civil installed.... and if i separate in the first phase the code based on the {if is civil = true} it works. Then i will try to use reflections to see if i am able to make it work into a non civil computer. the 2 dlls require me to the same program written twice with a minor tweak on the map3d one. (I require a coordinate transformation).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 13:28:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8512987#M23839</guid>
      <dc:creator>dan.popescu9NZJ8</dc:creator>
      <dc:date>2019-01-10T13:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8513607#M23840</link>
      <description>&lt;P&gt;You can use the same code base to build two separate dlls using conditional compliation as I showed above.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 16:25:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8513607#M23840</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2019-01-10T16:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8514367#M23841</link>
      <description>&lt;P&gt;i will try to do that. Can you point me to an example?&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 20:18:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8514367#M23841</guid>
      <dc:creator>dan.popescu9NZJ8</dc:creator>
      <dc:date>2019-01-10T20:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: autocad app version references</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8517348#M23842</link>
      <description>&lt;P&gt;the code that I showed above was supposed to be an example of that, but I mistakenly used "#ifdef" rather than "#if" (#ifdef is for C++, which is what I've been mostly coding with these days).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the correct example would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cl_prompt.AddAllowedClass(typeof(Autodesk.AutoCAD.DatabaseServices.Polyline), false);
&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;#if CIVIL3D&lt;/FONT&gt;&lt;/STRONG&gt;
cl_prompt.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.Alignment), false);
&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;#endif&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code appearing between &lt;STRONG&gt;#if CIVIL3D&lt;/STRONG&gt; and &lt;STRONG&gt;#endif&lt;/STRONG&gt; would only be compiled when the preprocessor symbol &lt;STRONG&gt;CIVIL3D&lt;/STRONG&gt; is defined. Hence, you must define that symbol when building for Civil3D, and undefine it when building for Map3d.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 22:09:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-app-version-references/m-p/8517348#M23842</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2019-01-11T22:09:24Z</dc:date>
    </item>
  </channel>
</rss>

