<?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: VBA - program which can steering model in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/7734619#M141094</link>
    <description>&lt;P&gt;Thanks for that code example.&amp;nbsp; I do have a question regarding driving constraints in a larger assembly.&amp;nbsp; I'm trying to drive a set of two constraints in a larger assembly and can drive them just fine in a similar fashion to the example you provided.&amp;nbsp; However, the update method seems to take much longer than when I drive a the same constraint using the Drive functionality.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to speed up the Update method, or limit it to only update the two constraints I'm changing?&amp;nbsp; Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2018 00:24:25 GMT</pubDate>
    <dc:creator>Brett.G</dc:creator>
    <dc:date>2018-01-30T00:24:25Z</dc:date>
    <item>
      <title>VBA - program which can steering model</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/2955014#M141088</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was created model of industrial robot with assembly and I need to create program in VBA, which can be used to steering robot arms in model for example used keyboard. Program have to include assembly too. I don't know what I should start do this... Please help me or&amp;nbsp; show me some example with this. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2011 21:12:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/2955014#M141088</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-16T21:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: VBA - program which can steering model</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/2959388#M141089</link>
      <description>&lt;P&gt;Ok maby other way... It possible to drive constraint in VBA??? If yes, my question is how can I do this??? I create 3 special move constraint, which let me sterring robots, and this can be good idea to drive constraint by program.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2011 16:36:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/2959388#M141089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-21T16:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: VBA - program which can steering model</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/2961276#M141090</link>
      <description>&lt;P&gt;The API supports to drive constraint since Inventor 2012.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2011 02:29:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/2961276#M141090</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2011-03-23T02:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: VBA - program which can steering model</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/3706158#M141091</link>
      <description>&lt;P&gt;Any ideas how to drive an assembly constraint from a vba macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mike.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2012 16:56:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/3706158#M141091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-20T16:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: VBA - program which can steering model</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/3717482#M141092</link>
      <description>&lt;P&gt;Activate an assembly with mate constraint "Plane" and run this VBA macro.&lt;/P&gt;
&lt;P&gt;Please search&amp;nbsp;Inventor API Help for &amp;nbsp;DriveConstraintSettings object &amp;nbsp;methods and properties.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Test_DriveCOnstraint()

  Dim oDoc As AssemblyDocument
  Set oDoc = ThisApplication.ActiveDocument
  Dim oDef As AssemblyComponentDefinition
  Set oDef = oDoc.ComponentDefinition
  
  Dim oCon As MateConstraint
  Set oCon = oDef.Constraints.Item("Plane")
   
  If oCon.DriveConstraintSettings.IsInitialized Then
    Dim oDS As DriveConstraintSettings
    Set oDS = oCon.DriveConstraintSettings
    With oDS
      .StartValue = "0 mm"
      .EndValue = "50 mm"
      .PauseDelay = 0.01
      .GoToStart
      .PlayForward
      .PlayReverse
    End With
    Beep
  Else
    MsgBox "Doesn't initialized"
  End If
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 12:10:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/3717482#M141092</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2012-11-30T12:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: VBA - program which can steering model</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/3733020#M141093</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Any ideas how to drive an assembly constraint from a vba macro?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mike.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think rather than using the "Drive Constraint" functionality you likely want to control them yourself because you'll need more control and may want to change more than one constraint at a time.&amp;nbsp; You can do this by change the values of the parameters that the constraint depends on.&amp;nbsp; This is essentiallly what the "Drive Constraint" command is doing too.&amp;nbsp; Here's a simple example that will drive the two parameters "Angle" and "Distance".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub DriveParameters()
    ' Get the active assembly document.
    Dim asmDoc As AssemblyDocument
    Set asmDoc = ThisApplication.ActiveDocument
    
    ' Get the parameters object.
    Dim params As Parameters
    Set params = asmDoc.ComponentDefinition.Parameters
    
    ' Get the Distance and Angle parameters.  This will fail
    ' if they don't exist.
    Dim distParam As Parameter
    Dim angleParam As Parameter
    Set distParam = params.Item("Distance")
    Set angleParam = params.Item("Angle")
    
    ' Calculate the distance and angle for each iteration.
    Dim pi As Double
    pi = Atn(1) * 4
    Dim iterations As Integer
    iterations = 50
    
    Dim angleValue As Double
    angleValue = (pi / 2) / 50
    Dim distanceValue
    distanceValue = 0.1
    
    ' Iterate over a certain number of iterations.
    Dim i As Integer
    For i = 1 To iterations
        ' Set the parameter values.
        angleParam.Value = angleParam.Value + angleValue
        distParam.Value = distParam.Value + distanceValue
        
        ' Update the document and the view to see each step.
        asmDoc.Update
        ThisApplication.ActiveView.Update
    Next
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2012 01:20:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/3733020#M141093</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2012-12-12T01:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: VBA - program which can steering model</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/7734619#M141094</link>
      <description>&lt;P&gt;Thanks for that code example.&amp;nbsp; I do have a question regarding driving constraints in a larger assembly.&amp;nbsp; I'm trying to drive a set of two constraints in a larger assembly and can drive them just fine in a similar fashion to the example you provided.&amp;nbsp; However, the update method seems to take much longer than when I drive a the same constraint using the Drive functionality.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to speed up the Update method, or limit it to only update the two constraints I'm changing?&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 00:24:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-program-which-can-steering-model/m-p/7734619#M141094</guid>
      <dc:creator>Brett.G</dc:creator>
      <dc:date>2018-01-30T00:24:25Z</dc:date>
    </item>
  </channel>
</rss>

