|
我在利用VB开发CAD时,只有一个窗体需要创建CAD对象,我先引用CAD,然后添加了一个窗体,在该窗体的代码窗体输入以下代码,VB中也是通过的,但并没有显示连接到了CAD界面,还是一个空白窗体!请各位帮忙指教一下!!(这段代码是来自一本参考书,但并没有达到效果,很是郁闷!!)
dim acadapp as acadapplication
private sub form_load
on error sub resume next
set acadapp=getobject(,".application")
if err then
err.clear
set acadapp=createobject("autocad.application")
if err then
msgbox("error!")
exit sub
end if
end if
acadapp.visible=ture
end sub
|
|