SolidWorksMakroprogrammierung

Methode · SketchBlockInstance

Select-Methode (SketchBlockInstance)

Wählt die Blockinstanz aus.

Syntax

Function Select( _
   ByVal Append As Boolean, _
   ByVal Data As SelectData _
) As Boolean
bErfolg = swBlockInst.Select(True, Nothing)

Parameter

AppendBooleanByVal
True: zur bisherigen Auswahl hinzufügen. False: die Auswahl durch diese Blockinstanz ersetzen.
DataSelectDataByVal
Auswahldaten (SelectData), etwa mit einer Markierung, oder Nothing.

Rückgabewert

True, wenn die Blockinstanz ausgewählt wurde, sonst False.

Beispiel

' swBlockDef ist eine Blockdefinition (SketchBlockDefinition), etwa aus SketchManager.GetSketchBlockDefinitions.
Dim vInstanzen As Variant
Dim swBlockInst As SldWorks.SketchBlockInstance
Dim i As Long
vInstanzen = swBlockDef.GetInstances
If IsArray(vInstanzen) Then
    For i = 0 To UBound(vInstanzen)
        Set swBlockInst = vInstanzen(i)
        swBlockInst.Select True, Nothing
    Next i
End If

Bemerkungen

Die Methode wählt die Blockinstanz aus und markiert sie. Beim Parameter Append spricht die Hilfe versehentlich von einem Detailkreis. Das Hilfebeispiel „Get Block Definitions in Part or Assembly“ wählt so alle Blockinstanzen eines Teils aus.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2007

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

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