zxj_76专家:你好!
我在VB工具栏的"引用"栏用勾选了AUTOCAD的相关选项,之后用了如下命令:Dim aCADline As Object Dim cad1 As Object 'AutoCAD对象 Dim cad2 As Object 'AutoCAD当前绘图模型区对象 Dim CADobj1 As Object, CADobj2 As Object, CADobj3 As Object '定义备用的三个CAD对象 Dim CADpoint1(3) As Double, CADpoint2(3) As Double, CADpoint3(3) As Double '定义备用的三个点变量 必须只能是数据型的 Dim txtMODE 'As AcadTextStyle '定义mytxt变量为文本样式 CADpoint1(1) = 0: CADpoint1(2) = 0: CADpoint2(1) = 800: CADpoint2(2) = 300: CADpoint3(1) = 800: CADpoint3(2) = 1000 Set cad1 = CreateObject("autocad.application"): cad1.Visible = True Set cad2 = cad1.ActiveDocument: cad1.ActiveDocument.Utility.InitializeUserInput 1 '该句命令使CAD接收VB的命令,并将在CAD中的输入传入VB的变量中
进行该定义后 Dim txtMODE 'As AcadTextStyle '定义mytxt变量为文本样式
由于版本问题(2002,2004),就会出错 ,能否找到一个通用格式
谢谢 |