DatabaseServices.HostApplicationServices.FindFile


Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.FindFile(String, Autodesk.AutoCAD.DatabaseServices.Database, Autodesk.AutoCAD.DatabaseServices.FindFileHint) As String


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



沿着曲线将面域扫掠为三维曲面或三维实体