首先打开vsto,创建窗体,添加一个按钮,双击按钮录入代码:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim cad As Object
cad = CreateObject("autocad.Application")
cad.Visible = True
cad.documents.Add
cad.application.documents.Open("D:\ZD\你的文件.dwg")
End Sub
End Class
由下图可见,已打开默认cad版本: