SolidWorksMakroprogrammierung

Methode · SelectionSet

GetSelectionSetItems-Methode (SelectionSet)

Liefert die Elemente des Auswahlsatzes.

Syntax

Function GetSelectionSetItems() As Variant
vElemente = swSatz.GetSelectionSetItems

Rückgabewert

Array der Elemente (SelectionSetItem).

Beispiel

' swSatz ist ein Auswahlsatz (SelectionSet), etwa aus SelectionSetFolder.GetSelectionSets.
Dim vElemente As Variant
vElemente = swSatz.GetSelectionSetItems
If IsEmpty(vElemente) Then
    Debug.Print swSatz.GetName & ": leer"
Else
    Debug.Print swSatz.GetName & ": " & UBound(vElemente) + 1 & " Elemente"
End If

Bemerkungen

Die Art jedes Elements liefert SelectionSet.GetSelectionSetItemTypes, in derselben Reihenfolge. Das Objekt hinter einem Element holst du mit SelectionSetItem.GetCorrespondingItem. Was ein leerer Satz liefert, sagt die Hilfe nicht, deshalb der Test mit IsEmpty.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2017

Englisches Original: ISelectionSet::GetSelectionSetItems in der SOLIDWORKS API-Hilfe ↗ (dort mit dem .NET-Namen)

Fragen zu diesem Befehl oder ein Befehl fehlt? Frag im Discord.