lpc9999 发表于 2007-6-13 21:17:00

为什么用vb打开cad会出两个cad,并且会出现cad帮助

为什么用vb打开cad会出两个cad,并且会出现cad帮助Private Sub Command1_Click()
Shell "E:\CAD2005\acad.exe", vbMaximizedFocus      '(打开cad )
SendKeys "{enter}", True
SendKeys "appload", True          '(加载lisp程序)
SendKeys "{enter}", True
SendKeys "\aa.lsp", True          '(调用lisp程序)
SendKeys "{enter}", True
SendKeys "{esc}", True
SendKeys "aa", True
SendKeys "{enter}", True
SendKeys "200,200", True      '(数据输入 )
SendKeys "{enter}", True
SendKeys "100,100", True
SendKeys "{enter}", True
End Sub
大家帮看看这段有什么问题啊! 为什么会打开好几个cad啊
aa.lisp:
(defun c:aa()
(setq p1 (getpoint"点1:"))
(setq p2 (getpoint"点2:"))
(command "line" p0 p1 "")
)
怎么看都觉的没什么问题啊!
大家帮帮忙啊看出问题的,我请吃饭啊!

烟雨.江南 发表于 2007-6-14 08:21:00

嗯,这样用VB调用CAD的,我似乎是第一次见到。 光看代码好象看不出为什么会出现两个CAD实例,但紧跟着Shell的那个Enter,是打开CAD帮助的原因。

lpc9999 发表于 2007-6-14 13:16:00

谢谢啊,那一般vb都用什么命令打开CAD并加载程序啊?
页: [1]
查看完整版本: 为什么用vb打开cad会出两个cad,并且会出现cad帮助