Valued Contributor
Posts: 91
Registered: ‎01-09-2009
Message 11 of 13 (243 Views)

Re: ThisDrawing.Path equivalent

01-13-2011 10:49 PM in reply to: aielli

dan.glassman => thx man!

New Member
Posts: 1
Registered: ‎12-31-2011
Message 12 of 13 (142 Views)

Re: ThisDrawing.Path equivalent

12-31-2011 03:35 PM in reply to: aielli

Public Sub Test1()

Dim path As string = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database.Filename.ToString

If Right(path,3) <> "dwg" then
MsgBox("This file has not been saved")
MsgBox("ThisDrawing = " & path)
End If

Dim NewPath As String = Left(path, Len(path)-3) & "dat"

End Sub

Posts: 3
Registered: ‎01-07-2012
Message 13 of 13 (115 Views)

Re: ThisDrawing.Path equivalent

01-07-2012 09:59 PM in reply to: aielli
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common

Public Shared ReadOnly Property ThisDrg() As AcadDocument
            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


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!