Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Public Class GetThisDrawingPath
<CommandMethod("GetThisDrawingPath")> _
Public Sub GetThisDrawingPath()
Dim acdDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim HostAppSrv As HostApplicationServices = HostApplicationServices.Current
Dim path As String = HostAppSrv.FindFile(acdDoc.Name, acdDoc.Database, FindFileHint.Default)
'其实acdDoc.Name等于path
acdDoc.Editor.WriteMessage(vbLf & "当前文档路径:" + path)
acdDoc.Editor.WriteMessage(vbLf & "系统变量DwgPrefix:" + Application.GetSystemVariable("DwgPrefix").ToString)
End Sub
End Class
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |