SolidWorksMakroprogrammierung

Methode · SimpleHoleFeatureData2

SetEndConditionReference-Methode (SimpleHoleFeatureData2)

Legt das Element fest, das die Endbedingung der einfachen Bohrung bestimmt, etwa eine Fläche.

Syntax

Sub SetEndConditionReference( _
   ByVal PDisp As Object _
)
swDaten.SetEndConditionReference swFace

Parameter

PDispObjectByVal
Das Element, etwa eine Fläche (Face2) oder ein Eckpunkt (Vertex).

Beispiel

' swModel ist das Teil (ModelDoc2), swFeat eine einfache Bohrung (Feature). Eine Fläche ist ausgewählt.
Dim swDaten As SldWorks.SimpleHoleFeatureData2
Dim swFace As SldWorks.Face2
Set swFace = swModel.SelectionManager.GetSelectedObject6(1, -1)
Set swDaten = swFeat.GetDefinition
If swDaten.AccessSelections(swModel, Nothing) Then
    swDaten.Type = swEndCondUpToSelection
    swDaten.SetEndConditionReference swFace
    If False = swFeat.ModifyDefinition(swDaten, swModel, Nothing) Then swDaten.ReleaseSelectionAccess
End If

Bemerkungen

Die gültigen Bezüge sind in swSelectionReferenceTypes_e aufgeführt: Eckpunkt, Kante, Fläche, Referenzfläche, Ebene, Skizzenpunkt und Körper. Das Hilfebeispiel „Set New End Condition for Simple Hole Feature“ setzt vorher SimpleHoleFeatureData2.Type auf swEndCondUpToSurface. Das Beispiel oben nimmt stattdessen swEndCondUpToSelection, weil swEndConditions_e davon abrät.

Mit swEndCondUpToSelection und einer übergebenen Fläche endet die Bohrung an dieser Fläche; SimpleHoleFeatureData2.Type liefert danach 10.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2003 SP01

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

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