08-20-2018
01:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-20-2018
01:36 AM
Try below iLogic code to move and rotate to drive constraints.
Sub Main()
Dim assyDoc As AssemblyDocument
assyDoc = ThisApplication.ActiveDocument
Dim oConstraint As AssemblyConstraint
For Each oConstraint In assyDoc.ComponentDefinition.Constraints
If oConstraint.Name = "move1" Then
If oConstraint.DriveConstraintSettings.IsInitialized Then
With oConstraint.DriveConstraintSettings
.StartValue = "0"
.EndValue = "155"
.GoToStart
.PlayForward
End With
End If
ElseIf oConstraint.Name = "rotate1" Then
If oConstraint.DriveConstraintSettings.IsInitialized Then
With oConstraint.DriveConstraintSettings
.StartValue = 0
.EndValue = 45
.GoToStart
.PlayForward
End With
End If
End If
Next
End Sub
Is it possible to rotate from 0 to -45?
Try 0 to 315 (360 - 45) to rotate from 0 to -45.
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
