Option Explicit Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Declare Function GetTickCount Lib "kernel32.dll" () As Long Private Type CurveElement ElemShape As Variant ElemStep As Long ElemRadius As Double ElemDirection As Long ElemCounter As Long End Type Private Const TIMER_INTERVAL As Long = 40 Private Const NUMBER_OF_POINTS As Long = 2000 Private Const NUMBER_OF_ELEMENTS As Long = 15 Function DrawCircle(myView As DrawingView, coords As Variant, r As Double) As Circle2D Dim fact2D As Factory2D Set fact2D = myView.Factory2D Dim myShape As Circle2D Set myShape = fact2D.CreateClosedCircle(coords(0), coords(1), r) Set DrawCircle = myShape End Function Sub Main() ' get active view Dim myView As DrawingView Set myView = CATIA.ActiveDocument.Sheets.ActiveSheet.Views.ActiveView ' get curve, first element is axis system Dim myCurve Set myCurve = myView.GeometricElements.Item(2) Dim elemArray() As CurveElement ReDim elemArray(NUMBER_OF_ELEMENTS) Dim i As Integer For i = 0 To NUMBER_OF_ELEMENTS Dim element As CurveElement With element .ElemRadius = i + 1 .ElemStep = i + 1 .ElemDirection = 1 Set .ElemShape = DrawCircle(myView, Array(0, 0), .ElemRadius) End With elemArray(i) = element Next Dim startTime As Long startTime = GetTickCount ' main timer loop Do If (GetTickCount - startTime) > TIMER_INTERVAL Then ' draw elements Dim t As QPCTimer Set t = CreateAndStartCounter() DrawElements myCurve, elemArray Debug.Print t.TimeElapsed 'reset time after redrawing startTime = GetTickCount End If ' pause execution Sleep 5 ' process events (do not block UI) DoEvents Loop While True End Sub Sub DrawElements(myCurve, elements() As CurveElement) Dim paramExtents(1) myCurve.GetParamExtents paramExtents Dim i As Long For i = 0 To UBound(elements) If elements(i).ElemCounter < 0 Or elements(i).ElemCounter > NUMBER_OF_POINTS Then elements(i).ElemDirection = -elements(i).ElemDirection Dim distanceRatio As Double distanceRatio = 1 / NUMBER_OF_POINTS * elements(i).ElemCounter Dim param As Double param = paramExtents(0) + (paramExtents(1) - paramExtents(0)) * distanceRatio Dim currPoint(1) myCurve.GetPointAtParam param, currPoint elements(i).ElemCounter = elements(i).ElemCounter + elements(i).ElemStep * elements(i).ElemDirection elements(i).ElemShape.SetData currPoint(0), currPoint(1), elements(i).ElemRadius Next End Sub ' to clear a view afterwards Sub CleanView() Dim sel Set sel = CATIA.ActiveDocument.Selection Dim myView As DrawingView Set myView = CATIA.ActiveDocument.Sheets.ActiveSheet.Views.ActiveView sel.Clear Dim i As Long For i = 1 To myView.GeometricElements.Count If i > 2 Then sel.Add myView.GeometricElements.Item(i) End If Next On Error Resume Next sel.Delete End Sub