<?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: Detect Autocad version - three questions in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781414#M51105</link>
    <description>&lt;P&gt;Look at &lt;A href="http://through-the-interface.typepad.com/through_the_interface/installation/" target="_self"&gt;http://through-the-interface.typepad.com/through_the_interface/installation/&lt;/A&gt; and check function &lt;SPAN style="line-height: 140%;"&gt;GetAutoCADKey&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;Also if you use function getACAD (by articad) you can get full path to acad.exe, i.e. &lt;STRONG&gt;Proc.MainModule.FileName&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Feb 2013 06:43:42 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2013-02-15T06:43:42Z</dc:date>
    <item>
      <title>Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781097#M51102</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The questions refer to an out-of-process program and a system with multiple Autocad versions installed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q1: &amp;nbsp;How do we detect the last run Autocad version?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Somewhere between 2004 and 2008, &lt;SPAN&gt;the system registry doesn't point to the&amp;nbsp;&lt;/SPAN&gt;last run version any more, but points&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;instead to&amp;nbsp;AcLauncher.exe which, presumably' has the info.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;The question is: How to get the actual path to or the version of, the last-run Acad.exe?&lt;/P&gt;&lt;P&gt;Q2: How does one detect which Autocad version is currently running?&lt;/P&gt;&lt;P&gt;Q3: How does one detect the Autocad version of a .dwg file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quite a mouthfull, but with your help I hope to find the solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;alex&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2013 19:38:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781097#M51102</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2013-02-14T19:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781137#M51103</link>
      <description>&lt;P&gt;Here is the answers to questions 2 and 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    Public Sub getACAD()
        Dim ProcessList As System.Diagnostics.Process()
        Dim Proc As System.Diagnostics.Process

        ProcessList = System.Diagnostics.Process.GetProcesses()

        For Each Proc In ProcessList
            If UCase(CStr(Proc.ProcessName)) = UCase("acad") Then
                ' FOUND RUNNING COPY
            End If
        Next
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A target="_blank" href="http://cadpanacea.com/node/359"&gt;http://cadpanacea.com/node/359&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;header &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD Version&lt;BR /&gt;AC1027 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD 2013&lt;BR /&gt;AC1024 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD 2010,2011,2012&lt;BR /&gt;AC1021 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD 2007, 2008, 2009&lt;BR /&gt;AC1018 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD 2004, 2005, 2006&lt;BR /&gt;AC1015 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD 2000, 2000i, 2002&lt;BR /&gt;AC1014 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD Release 14&lt;BR /&gt;AC1013 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD Release 13&lt;BR /&gt;AC1009 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD Release 11, 12&lt;BR /&gt;AC1006 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD Release 10&lt;BR /&gt;AC1004 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD Release 9&lt;BR /&gt;AC1003 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD 2.6&lt;BR /&gt;AC1002 &amp;nbsp;&amp;nbsp; &amp;nbsp;AutoCAD 2.5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Function is2010(ByVal filename As String) As Boolean
        'Return False
        Dim rtnCheck As Boolean = False

        If isFileInUse(filename) Then
            filename = createTempFileName(filename)
        End If

        Dim objReader As IO.StreamReader
        Dim txtContents As String
        ' Check if File Exists
        If IO.File.Exists(filename) Then
            objReader = IO.File.OpenText(filename)
            'Read all the Text in the File
            Do While objReader.Peek &amp;lt;&amp;gt; -1
                txtContents = objReader.ReadLine()
                '     MsgBox(txtContents.Substring(0, 6))
                If txtContents.Substring(0, 6) = "AC1024" Then
                    rtnCheck = True
                End If
                Exit Do
            Loop
            ' Don't forget to close the file
            objReader.Close()
            objReader = Nothing
        End If

        Return rtnCheck

    End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2013 20:04:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781137#M51103</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2013-02-14T20:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781375#M51104</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you&amp;nbsp;&lt;/SPAN&gt;Arcticad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is2010() looks just what I need. I'll just translate it to C# and try it.&lt;/P&gt;&lt;P&gt;Re: your sub getAcad(): OK, we found a running acad, now how do we detect which version it is?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 03:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781375#M51104</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2013-02-15T03:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781414#M51105</link>
      <description>&lt;P&gt;Look at &lt;A href="http://through-the-interface.typepad.com/through_the_interface/installation/" target="_self"&gt;http://through-the-interface.typepad.com/through_the_interface/installation/&lt;/A&gt; and check function &lt;SPAN style="line-height: 140%;"&gt;GetAutoCADKey&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;Also if you use function getACAD (by articad) you can get full path to acad.exe, i.e. &lt;STRONG&gt;Proc.MainModule.FileName&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 06:43:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781414#M51105</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-02-15T06:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781423#M51106</link>
      <description>&lt;P&gt;arcticad, here is your function translated to C# and beefed-up a little:&lt;/P&gt;&lt;PRE&gt;public string[] getRunningAcadVersions()
		{
			List&amp;lt;string&amp;gt; result = new List&amp;lt;string&amp;gt;();
			Process[] processList = System.Diagnostics.Process.GetProcesses();
			foreach (Process proc in processList)
			{
				if (proc.ProcessName.ToString().ToUpper() == "ACAD")
				{
					FileVersionInfo versionInfo = proc.MainModule.FileVersionInfo;
					int versionMajor = versionInfo.FileMajorPart;
					int versionMinor = versionInfo.FileMinorPart;
					string version = versionMajor.ToString("X") + "." + versionMinor.ToString("X");
					result.Add(version);
				}
			}
			return result.ToArray();
		}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;May it help others.&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 07:00:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781423#M51106</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2013-02-15T07:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781543#M51107</link>
      <description>&lt;P&gt;Awesome.&lt;/P&gt;&lt;P&gt;I wasn't aware of the CurVer key.&lt;/P&gt;&lt;P&gt;I kept using Win32API.FindExecutable(".dwg") and it pointed to AcLauncher.exe.&lt;/P&gt;&lt;P&gt;Now it's OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, Alexander, and Thank you, arcticad.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 10:45:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781543#M51107</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2013-02-15T10:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781550#M51108</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1506"&gt;@alex_b&lt;/a&gt; wrote:&lt;BR /&gt;...I wasn't aware of the CurVer key...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Alex! It is very old solution as far as I remember since AutoCAD R14.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 10:53:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781550#M51108</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-02-15T10:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Autocad version - three questions</title>
      <link>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781556#M51109</link>
      <description>&lt;P&gt;Shame on me!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 11:02:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/detect-autocad-version-three-questions/m-p/3781556#M51109</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2013-02-15T11:02:17Z</dc:date>
    </item>
  </channel>
</rss>

