addelementS method [VBA V8i SS3 fr ]

Bonjour,

I try to round off several lineelement

Dim Sc As ElementScanCriteria
Dim Ee As ElementEnumerator
Set Sc = New ElementScanCriteria
Sc.ExcludeAllTypes
Sc.IncludeType msdElementTypeLine
Set Ee = ActiveModelReference.Scan(Sc)
Dim LLanc As LineElement
Dim PtLL1 As Point3d
Dim PtLL2 As Point3d
Dim Ar() As Element
Do While Ee.MoveNext
    Dim LLNew As LineElement
    Set LLanc = Ee.Current
        With LLanc.startPoint
        PtLL1 = Point3dFromXYZ(Round(.X, 3), Round(.Y, 3), Round(.Z, 3))
        End With
        With LLanc.EndPoint
        PtLL2 = Point3dFromXYZ(Round(.X, 3), Round(.Y, 3), Round(.Z, 3))
        End With
    Set LLNew = CreateLineElement2(LLanc, PtLL1, PtLL2)
    ActiveModelReference.RemoveElement LLanc
    'ActiveModelReference.AddElement LLNew ' doesn't work if ee > 1024
Loop
RedrawAllViews

Doesn't work if the number of lines is up to 1024... 210

So I made a trick not very academic with « if..then.. end if » and « goto »

Suite:
If Ee.MoveNext Then
    Set LLanc = Ee.Current
    With LLanc.startPoint
    PtLL1 = Point3dFromXYZ(Round(.X, 3), Round(.Y, 3), Round(.Z, 3))
    End With
    With LLanc.EndPoint
    PtLL2 = Point3dFromXYZ(Round(.X, 3), Round(.Y, 3), Round(.Z, 3))
    End With
    Set LLNew = CreateLineElement2(LLanc, PtLL1, PtLL2)
    ActiveModelReference.RemoveElement LLanc
    ActiveModelReference.AddElement LLNew
    Ee.MoveNext
    GoTo Suite
End If
RedrawAllViews

I’d like tu use addelements method but i don’t see a example,

I ‘ve tried namedgroup, elementenumerator , arrays seems to be the best way but i failed

Does anyone have an example? Or help