两种方法在.Net中调用AutoCAD中的命令
两种方法在.Net中调用AutoCAD中的命令
http://www.cnblogs.com/swtool/p/SWTOOL_00012.html
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Interop
Public Class SendCommandTest
Private Declare Auto Function ads_queueexpr Lib "acad.exe" _
(ByVal strExpr As String) As Integer
Private Declare Auto Function acedPostCommand Lib "acad.exe" _
Alias "?acedPostCommand@@YAHPB_W@Z" _
(ByVal strExpr As String) As Integer
<CommandMethod("TEST1")> _
Public Sub SendStringToE x e c u t eTest()
Dim doc As Autodesk.AutoCAD.ApplicationServices.Document
doc = Application.DocumentManager.MdiActiveDocument
doc.SendStringToE x e c u t e("_POINT 1,1,0 ", False, False, True)
End Sub
<CommandMethod("TEST2")> _
Public Sub SendCommandTest()
Dim app As AcadApplication = Application.AcadApplication
app.ActiveDocument.SendCommand("_POINT 2,2,0 ")
End Sub
<CommandMethod("TEST3")> _
Public Sub PostCommandTest()
acedPostCommand("_POINT 3,3,0 ")
End Sub
<CommandMethod("TEST4")> _
Public Sub QueueExprTest()
ads_queueexpr("(command""_POINT"" ""4,4,0"")")
End Sub
End Class
Identifying the boundary through API
三板设计->快速从建筑图提取叠合楼板轮廓和面积
欢迎关注微信公众账号ByCAD