好象不是很难,进入后点工程--引用,弹出对话框,找到Autocad2004 type library( 我装的是2004版),接着做一个command1, 双击进入代码,代码为:
Private Sub mnu17_Click() On Error Resume Next
' 连接至 AutoCAD 应用程序 Dim acadApp As AcadApplication Set acadApp = GetObject(, "AutoCAD.Application.16") If Err Then Err.Clear Set acadApp = CreateObject("AutoCAD.Application.16") If Err Then MsgBox Err.Description Exit Sub End If End If
' 连接至 AutoCAD 图形 Dim acadDoc As AcadDocument Set acadDoc = acadApp.ActiveDocument