本人机械设计人员,想自己做点二次开发自己用,用的vs2012中的vb.net。
新建项目后添加引用,然后复制到本地=fasle。代码如下,运行时报错如图。
本人电脑win7x64,cpu选anycpu、anycpu优先x86、x86、x64都不行。
启用vs承载进程选与不选也都不行。
引用的文件确实存在,路径正确。
求各位二次开发高手、vb.net高手指点。
Imports Autodesk..Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.Colors
Public Class Form1
Dim acadapp As AutoCAD.AcadApplication
Dim acaddat As AutoCAD.AcadDatabase
Dim acaddoc As AutoCAD.AcadDocument
Dim pro() As System.Diagnostics.Process '搜索进程用
Dim acLyrTbl As Autodesk.AutoCAD.DatabaseServices.LayerTable
Dim acLyrTblRec As Autodesk.AutoCAD.DatabaseServices.LayerTableRecord
Dim acBlkTbl As Autodesk.AutoCAD.DatabaseServices.BlockTable
Dim acBlkTblRec As Autodesk.AutoCAD.DatabaseServices.BlockTableRecord
Private Sub Form1_Load() Handles MyBase.Load
'*****以下检测cad是否启动,不启动则启动,启动不了则报错。*****
pro = System.Diagnostics.Process.GetProcessesByName("acad")
If pro.Length