SolidWorksMakroprogrammierung

Methode · Configuration

AddPartExplodeStep-Methode (Configuration)

Fügt der Explosionsansicht eines Mehrkörperteils einen Schritt hinzu.

Syntax

Function AddPartExplodeStep( _
   ByVal ExplodeView As String, _
   ByVal ExplDist As Double, _
   ByVal ExplDirIndex As Long, _
   ByVal ReverseDir As Boolean, _
   ByVal AutoSpaceBodiesOnDrag As Boolean, _
   ByRef Error As Long _
) As Object
Set swSchritt = swConfig.AddPartExplodeStep(sAnsicht, 0.03, swExplodeDirectionIndex_XAxis, False, False, nFehler)

Parameter

ExplodeViewStringByVal
Name der Explosionsansicht, etwa aus Configuration.GetCurrentPartExplodeViewName.
ExplDistDoubleByVal
Weg in Metern.
ExplDirIndexLongByVal
Richtung, ein Wert aus swExplodeDirectionIndex_e.
ReverseDirBooleanByVal
True: Richtung umkehren.
AutoSpaceBodiesOnDragBooleanByVal
True: Körper beim Ziehen automatisch verteilen.
ErrorLongByRef · Rückgabe
Gibt einen Wert aus swCreatePartExplodeStepError_e zurück, swCreatePartExplodeStepError_Successful (0) bei Erfolg.

Rückgabewert

Der neue Schritt (PartExplodeStep).

Beispiel

' swModel ist das Mehrkörperteil, swPart dasselbe als PartDoc, swConfig die aktive Konfiguration.
' Die Körper sind mit Markierung 1 ausgewählt.
Dim sAnsicht As String
Dim swSchritt As SldWorks.PartExplodeStep
Dim nFehler As Long
sAnsicht = swConfig.GetCurrentPartExplodeViewName
swPart.ShowExploded True, sAnsicht
Set swSchritt = swConfig.AddPartExplodeStep(sAnsicht, 0.03, swExplodeDirectionIndex_XAxis, False, False, nFehler)
If nFehler = swCreatePartExplodeStepError_Successful Then swModel.EditRebuild3

Bemerkungen

Vorher legst du die Explosionsansicht mit PartDoc.CreateExplodedView an und aktivierst sie mit PartDoc.ShowExploded. Die Körper wählst du mit Markierung 1 aus, optional eine Richtung mit Markierung 2. Der Befehl leert die Auswahl und geht nicht bei offenem PropertyManager. Danach ModelDoc2.EditRebuild3.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2020

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

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