SolidWorksMakroprogrammierung

Eigenschaft · SMNormalCutFeatureData2

CutDirection-Eigenschaft (SMNormalCutFeatureData2)

Liest oder setzt die Kante, gerade Kurve oder ebene Fläche, die die Richtung des Normal-Schnitts festlegt.

Syntax

Property CutDirection As Object
swDaten.CutDirection = swFlaeche

Wert

Eine Kante, eine gerade Kurve oder eine ebene Fläche.

Beispiel

' swModel ist das Blechteil (ModelDoc2), swFeat ein Normal-Schnitt (Feature).
Dim swDaten As SldWorks.SMNormalCutFeatureData2
Dim swFlaeche As SldWorks.Face2
Set swDaten = swFeat.GetDefinition
If swDaten.AccessSelections(swModel, Nothing) Then
    ' erst nach AccessSelections auswählen, etwa mit SelectByRay
    Set swFlaeche = swModel.SelectionManager.GetSelectedObject6(1, -1)
    If Not swFlaeche Is Nothing Then swDaten.CutDirection = swFlaeche
    If False = swFeat.ModifyDefinition(swDaten, swModel, Nothing) Then swDaten.ReleaseSelectionAccess
End If

Bemerkungen

Beim Anlegen wählst du die Richtung mit der Markierung 8 aus, wenn SMNormalCutFeatureData2.NormalCutParameters swNormalCutExtent ist. Beim Ändern wählst du das Element erst nach SMNormalCutFeatureData2.AccessSelections aus, frühere Auswahlen gelten nicht mehr. Das Hilfebeispiel wählt eine Fläche mit ModelDocExtension.SelectByRay aus, holt sie mit SelectionMgr.GetSelectedObject6 und weist sie ohne Set zu, so wie das Snippet oben.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2019

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

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