<?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: PositionalRepresentation.SetConstraintValueOverride ==&amp;gt; use of parameter in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5057278#M124635</link>
    <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should be a defect, I logged it as 1517815, you can provide this number to us to check its status.&lt;/P&gt;</description>
    <pubDate>Tue, 27 May 2014 06:03:14 GMT</pubDate>
    <dc:creator>YuhanZhang</dc:creator>
    <dc:date>2014-05-27T06:03:14Z</dc:date>
    <item>
      <title>PositionalRepresentation.SetConstraintValueOverride ==&gt; use of parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5027604#M124632</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an assembly with two parts connected with a mate constraint. In the assembly there is a parameter 'Offset' present but somehow the below code fails on the line 'Call oPosRep.SetConstraintValueOverride(oConstraint, "Offset")'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I manually create a PosRep with an override on the mate constraint I am allowed to use the 'Offset' parameter. So why doesn't this work from VBA?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the below code does work if I replace 'Offset' with a numeric value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub CreatePosRep()
    
    Dim oAssCompDef As AssemblyComponentDefinition
    Set oAssCompDef = ThisApplication.ActiveDocument.ComponentDefinition
    
    Dim oPosRep As PositionalRepresentation
    Set oPosRep = oAssCompDef.RepresentationsManager.PositionalRepresentations.Add("PosRep1")
    
    Dim oConstraint As AssemblyConstraint
    Set oConstraint = oAssCompDef.Constraints(1)
    
    Call oPosRep.SetConstraintValueOverride(oConstraint, "Offset")

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully someone can shed some light on this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards, Daniël&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IV2013 Professional SP2 Update 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2014 07:39:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5027604#M124632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-13T07:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: PositionalRepresentation.SetConstraintValueOverride ==&gt; use of parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5036744#M124633</link>
      <description>&lt;P&gt;I suppose you experience the problem with he second argumrnt in the SetConstraintValueOverride method. Method expects the expression like “28 mm”. &amp;nbsp;The following code works for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub CreatePosRep()
    
    Dim oAssCompDef As AssemblyComponentDefinition
    Set oAssCompDef = ThisApplication.ActiveDocument.ComponentDefinition
    
    Dim oPosRep As PositionalRepresentation
    On Error Resume Next
    Set oPosRep = oAssCompDef.RepresentationsManager.PositionalRepresentations.Add("PosRep1")
    If Err &amp;lt;&amp;gt; 0 Then
      Set oPosRep = oAssCompDef.RepresentationsManager.PositionalRepresentations.Item("PosRep1")
    End If
    
    Dim oConstraint As AssemblyConstraint
    Set oConstraint = oAssCompDef.Constraints.Item("GAP")
    
    Call oPosRep.SetConstraintValueOverride(oConstraint, "15 mm")
  
  Beep
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;cheers,&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2014 08:17:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5036744#M124633</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2014-05-16T08:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: PositionalRepresentation.SetConstraintValueOverride ==&gt; use of parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5036758#M124634</link>
      <description>&lt;P&gt;Yes, as I already indicated in my first post the code does work if I use a numeric value. So "15" or "15 mm" does work as expected. However the use of a parameter does not work from the code. But I can use a parameter if I manually create an override constraint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniël&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2014 08:28:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5036758#M124634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-16T08:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: PositionalRepresentation.SetConstraintValueOverride ==&gt; use of parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5057278#M124635</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should be a defect, I logged it as 1517815, you can provide this number to us to check its status.&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2014 06:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/positionalrepresentation-setconstraintvalueoverride-gt-use-of/m-p/5057278#M124635</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2014-05-27T06:03:14Z</dc:date>
    </item>
  </channel>
</rss>

