sieben 发表于 2005-1-18 13:35:00

请教在VB中使用VLAX模块


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">本人参考<FONT face="Times New Roman"> </FONT>张帆 郑立楷 王华杰<FONT face="Times New Roman"> </FONT>先生的<<FONT face="Times New Roman">AutoCAD VBA </FONT>开发精彩实例教程>在<FONT face="Times New Roman">VB</FONT>中引用<FONT face="Times New Roman">VLAX</FONT>模块,及使用书中附的类模块,在<FONT face="Times New Roman">AutoCAD 2004 </FONT>和<FONT face="Times New Roman">Windows XP</FONT>环境下成功,但在<FONT face="Times New Roman">AutoCAD 2000</FONT>和<FONT face="Times New Roman">Windows 98</FONT>环境下不行,引用<FONT face="Times New Roman">AutoCAD 2000 type library</FONT> 部件我已更改过来,但<FONT face="Times New Roman">Visual Lisp AtiveX module </FONT>无法更改为<FONT face="Times New Roman">VL.OLB,</FONT>因为我不知道怎样取消原来对<FONT face="Times New Roman">VL16.OLB</FONT>引用,</FONT>


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3>下面是出错的位置,错误是:<FONT face="Times New Roman">Problem in loading Application</FONT></FONT>


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"><FONT size=3><SPAN style="mso-spacerun: yes">                       If Left(AcadApp.Version, 2) = "15" Then</FONT></FONT></SPAN>


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"><FONT size=3><SPAN style="mso-spacerun: yes">                                                       Set VL = AcadApp.GetInterfaceObject("VL.Application.1")</FONT></FONT></SPAN>


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"><FONT size=3><SPAN style="mso-spacerun: yes">                       ElseIf Left(AcadApp.Version, 2) = "16" Then</FONT></FONT></SPAN>


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"><FONT size=3><SPAN style="mso-spacerun: yes">                                                       Set VL = AcadApp.GetInterfaceObject("VL.Application.16")</FONT></FONT></SPAN>


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Times New Roman"><FONT size=3><SPAN style="mso-spacerun: yes">                       End If</FONT></FONT></SPAN>


<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3>请教我该怎么办<FONT face="Times New Roman">?? </FONT>请各位帮帮忙<FONT face="Times New Roman">!!</FONT></FONT>


</SPAN>

jiikoo 发表于 2014-1-18 13:48:53

AutoCAD2010版本应该为
If Left(AcadApp.Version, 2) = "18" Then
Set VL = AcadApp.GetInterfaceObject("VL.Application.16")
页: [1]
查看完整版本: 请教在VB中使用VLAX模块