是这样的。 '===================================================================================================== Call Example_InsertBlock(a)'a 是不定字符变量,根据要求建立不同的块名。 for i=1 to n'n值会在程序的其它地方给定此处未知 Call Example_Addline(x1,y1,x2,y2)'有关参数值的程序已被略掉 Call Example_AddCircle(x,y,r)
Next i '==============我是想把以上部分画的图元加入到未知变量“a”的块中======================================== Sub Example_AddLine(x1 as double,y1 as double,x2 as double,y2 as double)
Dim lineObj As AcadLine
Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double
startPoint(0) = x1: startPoint(1) = y1: startPoint(2) = 0#
endPoint(0) = x2: endPoint(1) = y2: endPoint(2) = 0#
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
ZoomAll
End Sub Sub Example_AddCircle(x1 as double,y1 as double,r as double)
Dim circleObj As AcadCircle
Dim centerPoint(0 To 2) As Double
Dim radius As Double
centerPoint(0) = x1: centerPoint(1) = y1: centerPoint(2) = 0#
radius = r
Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
End Sub
|