做了很久也解决不了的问题
今天做的头疼死了,请大家指点一下如果做一条直线上做间距递增的圆?O O O O O O O 很简单嘛,根据要求算出圆心坐标。 是呀,用VBA怎样编程? 你的直线方程,递增间距,起始位置等等,都得告诉别人啊。 递增间距就是要根据长度和最小间距,最大间距来设定.可我不知道怎么弄了.
以下是间距不变,直径递增的列子:
Sub DCircle()<BR> Dim Dist As Double<BR> Dim Cnt As Integer<BR> Dim MinR As Double<BR> Dim MaxR As Double<BR> Dim Pnt As Variant<BR> Dim Dir As Double<BR> On Error Resume Next<BR> With ThisDrawing.Utility<BR> Pnt = .GetPoint(, vbCr & "ÇëÈ·¶¨ÆðʼµãλÖãº")<BR> Dir = .GetAngle(Pnt, vbCr & "ÇëÈ·¶¨·½Ïò£º")<BR> Dist = .GetDistance(Pnt, vbCr & "ÇëÊäÈë¼ä¾à:")<BR> MinR = .GetDistance(Pnt, vbCr & "ÇëÊäÈë×îСԲֱ¾¶:") / 2<BR> MaxR = .GetDistance(Pnt, vbCr & "ÇëÊäÈë×î´óÔ²Ö±¾¶:") / 2<BR> Cnt = .GetInteger(vbCr & "ÇëÊäÈëÅÅÁиöÊý£º")<BR> End With<BR> Dim i As Integer<BR> Dim Center As Variant<BR> Dim radius As Double<BR> For i = 0 To Cnt - 1<BR> Center = ThisDrawing.Utility.PolarPoint(Pnt, Dir, Dist * i)<BR> radius = MinR + ((MaxR - MinR) / (Cnt - 1)) * i<BR> ThisDrawing.ModelSpace.AddCircle Center, radius<BR> Next i<BR>End Sub 你到底哪个量是不定的?
页:
[1]