Hide Table of Contents
CreateByRotateModel Method (IMotionStudy)

Creates an animation that rotates the model.

.NET Syntax

Visual Basic (Declaration) 
Function CreateByRotateModel( _
   ByVal DeleteExistingPath As System.Boolean, _
   ByVal Axis As System.Integer, _
   ByVal RotationCount As System.Integer, _
   ByVal Direction As System.Integer, _
   ByVal Duration As System.Double, _
   ByVal StartTime As System.Double _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As IMotionStudy
Dim DeleteExistingPath As System.Boolean
Dim Axis As System.Integer
Dim RotationCount As System.Integer
Dim Direction As System.Integer
Dim Duration As System.Double
Dim StartTime As System.Double
Dim value As System.Boolean
 
value = instance.CreateByRotateModel(DeleteExistingPath, Axis, RotationCount, Direction, Duration, StartTime)
C# 
System.bool CreateByRotateModel( 
   System.bool DeleteExistingPath,
   System.int Axis,
   System.int RotationCount,
   System.int Direction,
   System.double Duration,
   System.double StartTime
)
C++/CLI 
System.bool CreateByRotateModel( 
&   System.bool DeleteExistingPath,
&   System.int Axis,
&   System.int RotationCount,
&   System.int Direction,
&   System.double Duration,
&   System.double StartTime
) 

Parameters

DeleteExistingPath
True to delete any existing animation sequences, false to not
Axis
Axis about which to rotate the model as defined by swAnimatorAxisOfRotation_e
RotationCount
Number of rotations
Direction
Direction of rotation as defined by swAnimatorDirectionOfRotation_e
Duration
Length of time of the animation in seconds
StartTime
Time to start this animation (see Remarks)

Return Value

True if the animation is created, false if not

Example

Remarks

If you have existing animation sequences, then the start time of this animation should account for the total time of all previous sequences. If this is a new animation sequence, set StartTime to 0 to start the animation immediately, or type a value to delay the start of the sequence.

 

Example:

 

' Precondition: Active document contains a part or an assembly.

         

Option Explicit

 

Dim swApp As SldWorks.SldWorks

Dim swModel As SldWorks.ModelDoc2

Dim swModelDocExt As SldWorks.ModelDocExtension

Dim swMotionMgr As SwMotionStudy.MotionStudyManager

Dim swMotion As SwMotionStudy.MotionStudy

Dim boolstatus As Boolean

 

Sub main()

 

Set swApp = Application.SldWorks

'

Set swModel = swApp.ActiveDoc

Set swModelDocExt = swModel.Extension

Set swMotionMgr = swModelDocExt.GetMotionStudyManager

' Create a new motion study

Set swMotion = swMotionMgr.CreateMotionStudy

' Delete any existing animation sequences,

' set the animation duration to 5 seconds, and play

' the animation immediately when IMotionStudy::Play is called

boolstatus = swMotion.CreateByRotateModel(True, swRotationAboutXAxis, 1, swRotationClockwise, 10, 0)

' Play the animation

swMotion.Play

 

End Sub

 

See Also

Availability

SOLIDWORKS 2008 FCS, Revision Number 16.0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   CreateByRotateModel Method (IMotionStudy)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2015 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.