<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to drive constraints in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/8210439#M87866</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3445343"&gt;@martinhoos&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code to move and rotate to drive constraints.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;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&lt;/PRE&gt;
&lt;P&gt;Is it possible to rotate from 0 to -45?&lt;/P&gt;
&lt;P&gt;Try 0 to 315 (360 - 45) to rotate from 0 to -45.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
    <pubDate>Mon, 20 Aug 2018 08:38:57 GMT</pubDate>
    <dc:creator>chandra.shekar.g</dc:creator>
    <dc:date>2018-08-20T08:38:57Z</dc:date>
    <item>
      <title>How to drive constraints</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/8203531#M87743</link>
      <description>&lt;P&gt;Hello together,&lt;/P&gt;&lt;P&gt;i need your your help. I like to drive, move&amp;nbsp;and rotate constraints with ilogic. The following code rotates all of the driven constraints. The code shouldt be drive only a constraint named&amp;nbsp;"move1"&amp;nbsp;vertical from 0 to 155 and rotated an other constraint named "rotate1"&amp;nbsp;from 0 to 45 degree. Is that possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And another question: The code rotates clockwise from 0 to 45 degree. Is it possible to rotate from 0 to -45?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Regards Martin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub Main()
    Dim assyDoc As AssemblyDocument
    assyDoc = ThisApplication.ActiveDocument
    Dim oConstraint As AssemblyConstraint
    For Each oConstraint In assyDoc.ComponentDefinition.Constraints
        If oConstraint.DriveConstraintSettings.IsInitialized Then
            With oConstraint.DriveConstraintSettings

				.StartValue = 0
                .EndValue = 45
                .GoToStart               
                .PlayForward
'                .StartValue = 0
'                .EndValue = 150
'                .GoToEnd
'                .PlayReverse

			End With
        End If
    Next
End Sub&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Aug 2018 10:17:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/8203531#M87743</guid>
      <dc:creator>martinhoos</dc:creator>
      <dc:date>2018-08-16T10:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to drive constraints</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/8210439#M87866</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3445343"&gt;@martinhoos&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code to move and rotate to drive constraints.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;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&lt;/PRE&gt;
&lt;P&gt;Is it possible to rotate from 0 to -45?&lt;/P&gt;
&lt;P&gt;Try 0 to 315 (360 - 45) to rotate from 0 to -45.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 08:38:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/8210439#M87866</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-08-20T08:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to drive constraints</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/8210753#M87873</link>
      <description>&lt;P&gt;Hello Chandra,&lt;/P&gt;&lt;P&gt;thank you very much for your help! Great work...&lt;/P&gt;&lt;P&gt;Regards Martin&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 11:19:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/8210753#M87873</guid>
      <dc:creator>martinhoos</dc:creator>
      <dc:date>2018-08-20T11:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to drive constraints</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/12916853#M169860</link>
      <description>&lt;P&gt;How i can drive multiple constraints ?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 11:46:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-drive-constraints/m-p/12916853#M169860</guid>
      <dc:creator>miroslav.roydev</dc:creator>
      <dc:date>2024-07-24T11:46:11Z</dc:date>
    </item>
  </channel>
</rss>

