Drop ComplexStringElement

Dear friends,

Good morning! I would like to drop a complexStringElement. This is my code.

 

Sub element()

Dim oEnumeration As ElementEnumerator
Dim scanCriteria As New ElementScanCriteria
Dim counter As Integer
Dim element As element

scanCriteria.ExcludeAllTypes
'scanCriteria.IncludeType msdElementTypeLine
scanCriteria.IncludeType msdElementTypeBsplineCurve
scanCriteria.IncludeType msdElementTypeComplexString

Set oEnumeration = ActiveModelReference.Scan(scanCriteria)

Do While oEnumeration.MoveNext
    If oEnumeration.Current.IsComplexStringElement Then
    counter = counter + 1
    oEnumeration.Current.IsHighlighted = True
    oEnumeration.Current.AsComplexStringElement.Drop
    Else
    oEnumeration.Current.IsHighlighted = False
    End If
Loop
MsgBox "ELEMENT: " & counter

End Sub

 

what can I do?

 

Thanks!

Parents
  • rodrigo.teodoro said:
    oEnumeration.Current.AsComplexStringElement.Drop

    From VBA help:

    Drop does not alter the element that is dropped. Instead, it creates an ElementEnumerator that has elements that are equivalent to the original element. To replace the original element, first call Drop. Then call RemoveElement for the element being dropped. Finally, call AddElement for each element in the enumeration.

    Dim oComponents As ElementEnumerator

    Set oComponents = oEnumeration.Current.AsComplexStringElement.Drop

    ... iterate oComponents

     
    Regards, Jon Summers
    LA Solutions

Reply
  • rodrigo.teodoro said:
    oEnumeration.Current.AsComplexStringElement.Drop

    From VBA help:

    Drop does not alter the element that is dropped. Instead, it creates an ElementEnumerator that has elements that are equivalent to the original element. To replace the original element, first call Drop. Then call RemoveElement for the element being dropped. Finally, call AddElement for each element in the enumeration.

    Dim oComponents As ElementEnumerator

    Set oComponents = oEnumeration.Current.AsComplexStringElement.Drop

    ... iterate oComponents

     
    Regards, Jon Summers
    LA Solutions

Children