<?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: Current Drawing Location Path in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008662#M60985</link>
    <description>&lt;P&gt;Sorry you want the folder,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Application.GetSystemVariable("DWGPREFIX")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or another way&lt;/P&gt;&lt;P&gt;make sure you Import System.IO&lt;/P&gt;&lt;P&gt;Change previos Post to&lt;/P&gt;&lt;PRE&gt; &amp;lt;CommandMethod("GetFileName")&amp;gt; _
        Sub GetFileName()
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim ed As Editor = doc.Editor
            ed.WriteMessage(Path.GetDirectoryName(doc.Name) &amp;amp; vbCrLf)
            ed.WriteMessage(Path.GetDirectoryName(db.OriginalFileName))
        End Sub&lt;/PRE&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>Sat, 30 Apr 2011 08:57:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-04-30T08:57:41Z</dc:date>
    <item>
      <title>Current Drawing Location Path</title>
      <link>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008548#M60983</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using vb.net and I need to find the directory path that my current or open drawing is located in.&amp;nbsp; I'm not sure how to get this from vb.net.&amp;nbsp; Any help is appreciated.&amp;nbsp;&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2011 02:45:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008548#M60983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-30T02:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Current Drawing Location Path</title>
      <link>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008648#M60984</link>
      <description>&lt;P&gt;Take a look at&lt;/P&gt;&lt;P&gt;Document.Name&lt;/P&gt;&lt;P&gt;Database.OriginalFileName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        &amp;lt;CommandMethod("GetFileName")&amp;gt; _
        Sub GetFileName()
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim ed As Editor = doc.Editor

            ed.WriteMessage(doc.Name &amp;amp; vbCrLf)
            ed.WriteMessage(db.OriginalFileName)

        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2011 08:21:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008648#M60984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-30T08:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Current Drawing Location Path</title>
      <link>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008662#M60985</link>
      <description>&lt;P&gt;Sorry you want the folder,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Application.GetSystemVariable("DWGPREFIX")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or another way&lt;/P&gt;&lt;P&gt;make sure you Import System.IO&lt;/P&gt;&lt;P&gt;Change previos Post to&lt;/P&gt;&lt;PRE&gt; &amp;lt;CommandMethod("GetFileName")&amp;gt; _
        Sub GetFileName()
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim ed As Editor = doc.Editor
            ed.WriteMessage(Path.GetDirectoryName(doc.Name) &amp;amp; vbCrLf)
            ed.WriteMessage(Path.GetDirectoryName(db.OriginalFileName))
        End Sub&lt;/PRE&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>Sat, 30 Apr 2011 08:57:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008662#M60985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-30T08:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Current Drawing Location Path</title>
      <link>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008708#M60986</link>
      <description>&lt;P&gt;Thank you for your post.&amp;nbsp; This is exactly what i was looking for.&amp;nbsp; I have a another question now that I'm seeing the output of this.&amp;nbsp; Is there a way to go up one folder level in the directory path?&amp;nbsp; Or i would have to manually trim the string?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2011 13:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008708#M60986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-30T13:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Current Drawing Location Path</title>
      <link>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008716#M60987</link>
      <description>&lt;PRE&gt;        &amp;lt;CommandMethod("GetFileName")&amp;gt; _
        Sub GetFileName()
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim ed As Editor = doc.Editor

            ed.WriteMessage(Path.GetDirectoryName(doc.Name) &amp;amp; vbCrLf)
            ed.WriteMessage(Path.GetDirectoryName(db.OriginalFileName) &amp;amp; vbCrLf)


            Dim fpath As String = Path.GetDirectoryName(doc.Name)


            While fpath &amp;lt;&amp;gt; Nothing
                ed.WriteMessage(fpath &amp;amp; vbCrLf)
                fpath = Path.GetDirectoryName(fpath)
            End While

            fpath = doc.Name
            Dim levels As Integer = ed.GetInteger("Enter number of levels you want" &amp;amp; vbCrLf).Value

            For i As Integer = 0 To levels
                fpath = Path.GetDirectoryName(fpath)
                If fpath = Nothing Then
                    Exit For
                End If
            Next
            ed.WriteMessage(fpath &amp;amp; vbCrLf)

        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2011 13:59:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/current-drawing-location-path/m-p/3008716#M60987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-30T13:59:01Z</dc:date>
    </item>
  </channel>
</rss>

