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
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! | |||
作者: | 用户:
密码: 注册? 验证: |
||
评论:
禁止表情 禁止UBB 禁止图片 识别链接 识别关键字 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|||