<?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: ThisDrawing.Path equivalent in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610802#M67719</link>
    <description>&lt;B&gt;AcadDoc.Name&lt;/B&gt; was the reply I gave in your duplicated post:&lt;BR /&gt;
http://discussion.autodesk.com/forums/thread.jspa?threadID=757438&amp;amp;tstart=0&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Thanks, but I don't believe that ActiveDocument is a property of AcadApplication.&lt;BR /&gt;
Yes it is, but DeanLyon is using COM interop rather than .NET API</description>
    <pubDate>Tue, 05 Jan 2010 20:05:58 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2010-01-05T20:05:58Z</dc:date>
    <item>
      <title>ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610797#M67714</link>
      <description>What's the equivalent of ThisDrawing.Path in VB.NET?&lt;BR /&gt;
&lt;BR /&gt;
Here's what I think it should be... but it's not working:&lt;BR /&gt;
&lt;BR /&gt;
Dim AcadDoc As Document = Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;
AcadDoc.Path?  or GetPath?&lt;BR /&gt;
&lt;BR /&gt;
Slowly learning... thanks for the help.&lt;BR /&gt;
eric</description>
      <pubDate>Tue, 05 Jan 2010 13:29:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610797#M67714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-05T13:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610798#M67715</link>
      <description>In C# i did it this way:&lt;BR /&gt;
            AcadApplication oAcadApp = (AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;&lt;BR /&gt;
            String sFilePath = oAcadApp.ActiveDocument.Path  + "\\" + oAcadApp.ActiveDocument.Name;&lt;BR /&gt;
&lt;BR /&gt;
so, In VB.NET I think it would be like this:&lt;BR /&gt;
&lt;BR /&gt;
 Dim oAcadApp as AcadApplication&lt;BR /&gt;
Dim sFilePath as String&lt;BR /&gt;
Set oAcadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;&lt;BR /&gt;
sFilePath = oAcadApp.ActiveDocument.Path  &amp;amp; "\" &amp;amp; oAcadApp.ActiveDocument.Name;&lt;BR /&gt;
&lt;BR /&gt;
The path is only the path and the name is only the name.</description>
      <pubDate>Tue, 05 Jan 2010 15:41:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610798#M67715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-05T15:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610799#M67716</link>
      <description>Thanks, but I don't believe that ActiveDocument is a property of AcadApplication.  &lt;BR /&gt;
&lt;BR /&gt;
I'm using AutoCAD 2010...  not sure if this has changed...</description>
      <pubDate>Tue, 05 Jan 2010 19:03:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610799#M67716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-05T19:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610800#M67717</link>
      <description>This works in 2010   &lt;BR /&gt;
{code}&lt;BR /&gt;
Dim oAcadApp As Autodesk.AutoCAD.ApplicationServices.Document&lt;BR /&gt;
oAcadApp = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;
MsgBox(oAcadApp.Name)&lt;BR /&gt;
{code}</description>
      <pubDate>Tue, 05 Jan 2010 19:24:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610800#M67717</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-01-05T19:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610801#M67718</link>
      <description>Thank you!&lt;BR /&gt;
&lt;BR /&gt;
Didn't realize that the Name property gave the full path.</description>
      <pubDate>Tue, 05 Jan 2010 19:52:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610801#M67718</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-05T19:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610802#M67719</link>
      <description>&lt;B&gt;AcadDoc.Name&lt;/B&gt; was the reply I gave in your duplicated post:&lt;BR /&gt;
http://discussion.autodesk.com/forums/thread.jspa?threadID=757438&amp;amp;tstart=0&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Thanks, but I don't believe that ActiveDocument is a property of AcadApplication.&lt;BR /&gt;
Yes it is, but DeanLyon is using COM interop rather than .NET API</description>
      <pubDate>Tue, 05 Jan 2010 20:05:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610802#M67719</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2010-01-05T20:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610803#M67720</link>
      <description>As mentioned above, This works with COM in 2010&lt;BR /&gt;
&lt;BR /&gt;
{code}     &lt;BR /&gt;
   Dim oAcadApp As Autodesk.AutoCAD.Interop.AcadApplication&lt;BR /&gt;
        Try&lt;BR /&gt;
            oAcadApp = GetObject(, "AutoCAD.Application.18")&lt;BR /&gt;
            Dim sFilePath As String&lt;BR /&gt;
            sFilePath = oAcadApp.ActiveDocument.Path &amp;amp; "\" &amp;amp; oAcadApp.ActiveDocument.Name&lt;BR /&gt;
            MsgBox(sFilePath)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            oAcadApp = Nothing&lt;BR /&gt;
        End Try&lt;BR /&gt;
{code}</description>
      <pubDate>Wed, 06 Jan 2010 06:48:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2610803#M67720</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-01-06T06:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2879884#M67721</link>
      <description>&lt;P&gt;Is there an equivalent for the .path for the .NET API? I don't have COM installed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I'm looking for it a couple days now but can't find a way to do it.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2011 16:04:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2879884#M67721</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-13T16:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2880050#M67722</link>
      <description>&lt;P&gt;Whoa -- no need for COM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Document doc = Application.DocumentManager.MdiActiveDocument;
string path = Path.GetDirectoryName(doc.Database.Filename);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2011 17:25:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2880050#M67722</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-13T17:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2880390#M67723</link>
      <description>&lt;P&gt;What about the "DWGPREFIX" system variable, it's easy to check in both .NET and COM interop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2011 20:15:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2880390#M67723</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2011-01-13T20:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2880918#M67724</link>
      <description>&lt;P&gt;dan.glassman =&amp;gt; thx man!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2011 06:49:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/2880918#M67724</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-14T06:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/3277987#M67725</link>
      <description>&lt;P&gt;&amp;lt;CommandMethod("Test1")&amp;gt;&lt;BR /&gt;Public Sub Test1()&lt;BR /&gt;&lt;BR /&gt;Dim path As string = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database.Filename.ToString&lt;/P&gt;&lt;P&gt;If Right(path,3) &amp;lt;&amp;gt; "dwg" then&lt;BR /&gt;MsgBox("This file has not been saved")&lt;BR /&gt;Else&lt;BR /&gt;MsgBox("ThisDrawing = " &amp;amp; path)&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;Dim NewPath As String = Left(path, Len(path)-3) &amp;amp; "dat"&lt;BR /&gt;MsgBox(NewPath)&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2011 23:35:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/3277987#M67725</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-31T23:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: ThisDrawing.Path equivalent</title>
      <link>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/3284759#M67726</link>
      <description>&lt;PRE&gt;Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common

Public Shared ReadOnly Property ThisDrg() As AcadDocument
        Get
            Return Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument
        End Get
    End Property


   Public Shared Function GetPath(ByVal ThisDrg As AcadDocument) As String
        Dim strPath As String = ThisDrg.FullName
        strPath = IO.Path.GetDirectoryName(strPath)
        Return strPath
    End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2012 05:59:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/thisdrawing-path-equivalent/m-p/3284759#M67726</guid>
      <dc:creator>beeb.pm.Net</dc:creator>
      <dc:date>2012-01-08T05:59:30Z</dc:date>
    </item>
  </channel>
</rss>

