给你一段参考程序 CAD为2006 启动很快 private acadapp As Object '建立Application对象 private acaddoc As Object '建立Document对象 private acaddocs As Object
On Error Resume Next get_statue = False Set acadapp = GetObject(, "autocad.application.16") '若AutoCad已启动 , 则直接得到一个 Application对象 If Err Then Err.Clear Else get_statue = True Set acaddoc = acadapp.ActiveDocument '设acaddoc为当前图形文件 Set acaddocs = acadapp.Documents End If
|