如何做一个程序同时支持两个版本的AutoCAD?
请问如何在VB6中做一个画园的程序,使得它可以同时支持AutoCAD2005和AutoCAD2007? 打开或获取cad时不要指定版本就可以啊 <P>如下就好了。</P><P>Dim obj_Acad As Object<BR>Dim obj_Doc As Object</P>
<P>'''<BR>Sub Main()<BR>On Error Resume Next<BR>Set obj_Acad = GetObject(, "autocad.application")<BR>If Err Then<BR> Err.Clear<BR> On Error Resume Next<BR> Set obj_Acad = CreateObject("autocad.application")<BR> If Err Then<BR> Err.Clear<BR> MsgBox "不能运行AutoCAD,请检查是否安装!", vbOKOnly, "警告!"<BR> Exit Sub<BR> End If<BR>End If<BR>obj_Acad.Visible = True<BR>obj_Acad.WindowState = autocad.acwindowstate.acmax<BR>AppActivate (obj_Acad.Caption)<BR>Set obj_Doc = obj_Acad.ActiveDocument<BR>obj_Doc.SendCommand ("(setq p2c::filepath """ + Replace(App.Path, "\", "\\") + "\\"") ")<BR>obj_Doc.SendCommand ("(load (strcat p2c::filepath ""Part2CAM.fas"")) ")<BR>obj_Doc.SendCommand ("(princ) ")<BR>End Sub<BR></P>
页:
[1]