不好意思,我是个新手,请教过程如何调用?
Sub drawcirculkarpavers()
Dim center As AcadPoint, radius As Double Dim counter As Integer With ThisDrawing.Utility center = .GetPoint(, "click the position for center.") radius = .GetDistance(center, "enter the radius") End With For counter = 0 To TextBox1 - 1 Set birckcircles(Count) = ThisDrawing.ModelSpace.AddCircle(center, radius - counter * radius / TextBox1) brickcircles(counter).Color = acRed brickcircles(counter).Update drawmortar center, counter, radius Next End Sub
Sub drawmortar(center As AcadPoint, counter As interger, radius As Double) Dim startpoint(0 To 2) As Double, endpoint(0 To 2) As Double Dim theta As Double, stepsize As Double Static adjust As Double If User = True Then stepsize = 15 * pi / 180 Else stepsize = 30 * pi / 180 If adjust = 0 Then adjust = 15 * pi / 180 Else adjust = 0 End If End If For theta = 0 To 360 * pi / 180 Step stepsize startpoint(0) = (radius - counter * radius / TextBox1) * Cos(theta + adjust) + center(0) startpoint(1) = (radius - counter * radius / TextBox1) * Sin(theta + adjust) + center(1)
endpoint(0) = (radius - (counter + 1) * radius / TextBox1) * Cos(theta + adjust) + center(0) endpoint(1) = (radius - (counter + 1) * radius / TextBox1) * Sin(theta + adjust) + center(1) With ThisDrawing.ModelSpace .AddLine startpoint, endpoint .Item(.Count - a).Update End With Next
End Sub
编译老是通不过,说红色的部分未定义,不知如何修改,谢谢! |