Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

Grouping elements based on properties

$
0
0

Hello, just received a new task: group elements in selection set as Named group if they don't have a property of Color "1".

I've made my template which looks logical to me, but still it does not group elements:

Public Sub TestGroupSelectionSetC()

    Dim myElement As Element
    Dim myElemEnum As ElementEnumerator
    Dim myGroup As NamedGroupElement
    Set myGroup = ActiveModelReference.GetNamedGroup("GroupA")
    Dim OElement As NamedGroupMember


    Set myElemEnum = ActiveModelReference.GetSelectedElements

    Do While myElemEnum.MoveNext
        Set myElement = myElemEnum.Current
        If Not myElement.Color = 1 Then
            Set OElement = myGroup.AddMember(myElement)
        End If
    Loop
End Sub

Please advice, I'm novice in VBA.

Thanks is advance !


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>