SolidWorksMakroprogrammierung

Methode · SimulationMotorFeatureData

DistanceMotor-Methode (SimulationMotorFeatureData)

Stellt den Motor auf einen Weg, den er ab einer Startzeit in einer bestimmten Dauer zurücklegt.

Syntax

Sub DistanceMotor( _
   ByVal Displacement As Double, _
   ByVal StartTime As Double, _
   ByVal Duration As Double _
)
swMotor.DistanceMotor 90, 0, 2

Parameter

DisplacementDoubleByVal
Der Weg, die Hilfe gibt ihn in Grad an.
StartTimeDoubleByVal
Die Startzeit in Sekunden.
DurationDoubleByVal
Die Dauer in Sekunden.

Beispiel

' swModel ist die Baugruppe (ModelDoc2), swFeat ein Drehmotor-Feature (Feature).
Dim swMotor As SldWorks.SimulationMotorFeatureData
Set swMotor = swFeat.GetDefinition
swMotor.DistanceMotor 90, 0, 2               ' 90°, ab 0 s, 2 s lang
If False = swFeat.ModifyDefinition(swMotor, swModel, Nothing) Then Debug.Print "Ändern fehlgeschlagen"

Bemerkungen

Die Hilfe nennt für den Weg nur Grad. Welche Einheit bei einem Linearmotor gilt, sagt sie nicht.

Die Methode stellt SimulationMotorFeatureData.MotionType auf den Wert 1 (swSimulationMotorMotion_Step).

Siehe auch

Verfügbarkeit

SOLIDWORKS 2009

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

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