帮我看一段程序吧
<P>这段程序为绘制一个圆让后生成面域,但是我调试的时候只能绘出圆 ,到生成面域时出错:"时实错误426".请高人指点,谢谢!</P><P>Const pi = 3.1415926<BR>Dim r As Double<BR>Dim Acadapp As AutoCAD.AcadApplication<BR></P>
<P>Private Sub Command4_Click()<BR>Call drwPicture<BR>End Sub<BR> '绘制面域<BR> Sub drwPicture()<BR> Call linkCad<BR> Dim curves(0) As AutoCAD.AcadEntity<BR> Dim centerpoint(2) As Double<BR> r = 600<BR> centerpoint(0) = 0: centerpoint(1) = 0: centerpoint(2) = 0<BR> Set curves(0) = Acadapp.ActiveDocument.ModelSpace.AddCircle(centerpoint, r)<BR> Dim obj As Object<BR> obj = Acadapp.ActiveDocument.ModelSpace.AddRegion(curves)<BR> <BR> End Sub</P>
<P>'建立与cad连接<BR>Sub linkCad()<BR>On Error Resume Next<BR> Set Acadapp = GetObject(, " AutoCAD.Application")<BR> If Err Then<BR> Err.Clear<BR> Set Acadapp = CreateObject("AutoCAD.Application")<BR> If Err Then<BR> MsgBox Err.Description<BR> Exit Sub<BR> End If<BR> End If<BR> Acadapp.Visible = True<BR> Acadapp.WindowState = AutoCAD.AcWindowState.acMax<BR>End Sub<BR></P> AddRegion函数的返回值是实体数组,而不是Object <P>要怎么呢?我是新手,谢谢</P>
页:
[1]