.NET

Reply
Valued Contributor
RPeter
Posts: 80
Registered: ‎01-09-2009
Message 11 of 13 (235 Views)

Re: ThisDrawing.Path equivalent

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

dan.glassman => thx man!

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

Re: ThisDrawing.Path equivalent

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

<CommandMethod("Test1")>
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")
Else
MsgBox("ThisDrawing = " & path)
End If

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

End Sub

Member
beeb.pm.Net
Posts: 3
Registered: ‎01-07-2012
Message 13 of 13 (107 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
        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

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community