新手请教:为什么到最后一步的时候不能画面域
<p>Sub mianyu()<br/>Dim p1 As Variant '端点坐标<br/>Dim p2 As Variant</p><p>Dim l() As Double </p><p>Dim temp(1 To 2) As AcadPolyline</p><p>p1 = ThisDrawing.Utility.GetPoint(, "输入点:") <br/>z = 0<br/>p1(2) = z <br/>ReDim l(0 To 2) <br/>l(0) = p1(0)<br/>l(1) = p1(1)<br/>l(2) = z<br/>On Error GoTo Err_Control <br/>Do <br/> p2 = ThisDrawing.Utility.GetPoint(p1, vbCr & "输入下一点:") <br/> z = 0<br/> p2(2) = z <br/> <br/> lub = UBound(l) <br/> ReDim Preserve l(lub + 3)<br/> For i = 1 To 3<br/> l(lub + i) = p2(i - 1)<br/> Next i<br/> If lub > 3 Then<br/> templ.Delete<br/> End If<br/> Set templ = ThisDrawing.ModelSpace.AddPolyline(l)<br/> p1 = p2<br/>Loop</p><p>Err_Control:<br/>Set temp2 = ThisDrawing.ModelSpace.AddPolyline(l)<br/>Dim regions As Variant<br/>regions = ThisDrawing.ModelSpace.AddRegion(temp)<br/>End Sub</p>
页:
[1]