Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

@martinhoos,

 

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