yao2001xp 发表于 2005-8-13 12:45:00

请教各位高手

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

uhuang 发表于 2005-8-14 17:23:00

可能的话,把整个工程打包发给我看看吧。<br>

从你这上面看的话,没有错。<br>
<br>
<br>
Email:<br>
uhuang@163.com<br>

yao2001xp 发表于 2005-8-14 21:52:00

好的,谢谢先

mccad 发表于 2005-8-14 22:06:00

程序太乱了些。问题很多,因为没有贴完整,很难调试。<BR>如果只是你所说的问题,那是因为你把<BR><FONT color=#ff0000>Sub drawmortar(center As AcadPoint, counter As interger, radius As Double)</FONT><BR>中的<FONT color=#ff0000>integer</FONT>写成了<FONT color=#ff0000>interger</FONT>。

yao2001xp 发表于 2005-8-15 09:17:00

<P>好的,谢谢!</P>
页: [1]
查看完整版本: 请教各位高手