只要知道函数的方程就可以画了 可以用循环画直线或者画点的方法,如下例绘制的阿基米德螺线:
Sub drawquxian()
Dim quxian As AcadPoint
Dim p(0 To 2) As Double
For i = 0 To 20 Step 0.01
p(0) = i * Sin(i)
p(1) = i * Cos(i)
p(2) = 0
Set quxian = ThisDrawing.ModelSpace.AddPoint(p)
Next i
ThisDrawing.Application.ZoomExtents
End Sub
Sub DrawCurse()
Dim i As Double
Dim objCurse As AcadPolyline
Dim Pnts(0 To 182) As Double
For i = 0 To 5 Step 0.1
Pnts(0 + i * 3 * 10) = i * Sin(i)
Pnts(1 + i * 3 * 10) = i * Cos(i)
Pnts(2 + i * 3 * 10) = 0
Next i
Set objCurse = ThisDrawing.ModelSpace.AddPolyline(Pnts)
End Sub