我猜你是在尝试这样的事情
http://www.theswamp.org/index.php?topic=39578.0
- '''' Const progIDstr As String = "AutoCAD.Application.18.1"'''---- 2011
- '''' Const progIDstr As String = "AutoCAD.Application.18.0"'''---- 2010
- Const progIDstr As String = "AutoCAD.Application.18.2" '''''' ---- 2012
- Dim app As AcadApplication = Nothing
- Try
- Try
- app = Marshal.GetActiveObject(progIDstr)
- app.Visible = True
- Catch
- app = New AcadApplicationClass()
- app.Visible = True
- End Try
- Catch ex As Exception
- Return
- End Try
|