http://docs.autodesk.com/ACD/2013/ENU/index.html?url ... 626F-4271-8B89-9773A7631D87.htm,topicNumber=d30e716937
Imports System.IO
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Runtime
<CommandMethod("OpenDrawing", CommandFlags.Session)> _
Public Sub OpenDrawing()
Dim strFileName As String = "C:\campus.dwg"
Dim acDocMgr As DocumentCollection = Application.DocumentManager
If (File.Exists(strFileName)) Then
acDocMgr.Open(strFileName, False)
Else
acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " & strFileName & _
" does not exist.")
End If
End Sub
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Runtime
<CommandMethod("OpenDrawing", CommandFlags.Session)> _
Public Sub OpenDrawing()
Dim strFileName As String = "C:\campus.dwg"
Dim acDocMgr As DocumentCollection = Application.DocumentManager
If (File.Exists(strFileName)) Then
acDocMgr.Open(strFileName, False)
Else
acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " & strFileName & _
" does not exist.")
End If
End Sub
在AutoCAD2016中找到,可以使用
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016 ... 30A8DCB-626F-4271-8B89-9773A7631D87-htm.html
Imports System.IO
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Runtime
<CommandMethod("OpenDrawing", CommandFlags.Session)> _
Public Sub OpenDrawing()
Dim strFileName As String = "C:\campus.dwg"
Dim acDocMgr As DocumentCollection = Application.DocumentManager
If (File.Exists(strFileName)) Then
DocumentCollectionExtension.Open(acDocMgr, strFileName, False)
Else
acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " & strFileName & _
" does not exist.")
End If
End Sub
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Runtime
<CommandMethod("OpenDrawing", CommandFlags.Session)> _
Public Sub OpenDrawing()
Dim strFileName As String = "C:\campus.dwg"
Dim acDocMgr As DocumentCollection = Application.DocumentManager
If (File.Exists(strFileName)) Then
DocumentCollectionExtension.Open(acDocMgr, strFileName, False)
Else
acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " & strFileName & _
" does not exist.")
End If
End Sub
[本日志由 tiancao1001 于 2017-02-14 09:37 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |