<?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 do you convert a constraint from mate to flush with ilogic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-do-you-convert-a-constraint-from-mate-to-flush-with-ilogic/m-p/11718240#M99087</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_Waguespack&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all thanks for your code i was looking vor a way to switch between flush and mate without supressing multiple constraints. I have one problem though i can't seem to put a string in the contraints.item property also the collection contraints doesnt contain a itembyname property. i have seen this before with the workplanes collection for example but there i am able to just insert a string in the item property. Do you maybe have any idea how to fix this?&lt;/P&gt;&lt;P&gt;I'm using inventor 2023.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;constraintName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"flushmate"&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oContraint&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyConstraint&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;Constraints&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;constraintName&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JeKl_0-1675162697461.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1169471i66DE1065DBB5FB3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JeKl_0-1675162697461.png" alt="JeKl_0-1675162697461.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your response!&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2023 10:58:28 GMT</pubDate>
    <dc:creator>Koekepeerke</dc:creator>
    <dc:date>2023-01-31T10:58:28Z</dc:date>
    <item>
      <title>How do you convert a constraint from mate to flush with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-do-you-convert-a-constraint-from-mate-to-flush-with-ilogic/m-p/7268870#M99085</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I had trouble finding an example, so I thought I'd post one here for future reference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;' a reference to the assembly component definintion.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

sName = "Constraint1" 

Dim oConstraint As AssemblyConstraint
oConstraint = oAsmCompDef.Constraints.Item(sName)

oInput = InputRadioBox("Select one", "Mate", "Flush", True, "ilogic")

If oInput = False
'convert to Flush
oConstraint = oConstraint.ConvertToFlushConstraint( oConstraint.EntityOne, oConstraint.EntityTwo, 0)
Else
'Convert to Mate
oConstraint = oConstraint.ConvertToMateConstraint( oConstraint.EntityOne, oConstraint.EntityTwo, 0)
End If

oConstraint.Name = sName&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 15:35:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-do-you-convert-a-constraint-from-mate-to-flush-with-ilogic/m-p/7268870#M99085</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2017-08-01T15:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do you convert a constraint from mate to flush with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-do-you-convert-a-constraint-from-mate-to-flush-with-ilogic/m-p/7268881#M99086</link>
      <description>&lt;P&gt;see attached 2017 files for a working example&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 15:37:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-do-you-convert-a-constraint-from-mate-to-flush-with-ilogic/m-p/7268881#M99086</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2017-08-01T15:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do you convert a constraint from mate to flush with ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-do-you-convert-a-constraint-from-mate-to-flush-with-ilogic/m-p/11718240#M99087</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_Waguespack&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all thanks for your code i was looking vor a way to switch between flush and mate without supressing multiple constraints. I have one problem though i can't seem to put a string in the contraints.item property also the collection contraints doesnt contain a itembyname property. i have seen this before with the workplanes collection for example but there i am able to just insert a string in the item property. Do you maybe have any idea how to fix this?&lt;/P&gt;&lt;P&gt;I'm using inventor 2023.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;constraintName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"flushmate"&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oContraint&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyConstraint&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;Constraints&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;constraintName&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JeKl_0-1675162697461.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1169471i66DE1065DBB5FB3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JeKl_0-1675162697461.png" alt="JeKl_0-1675162697461.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your response!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 10:58:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-do-you-convert-a-constraint-from-mate-to-flush-with-ilogic/m-p/11718240#M99087</guid>
      <dc:creator>Koekepeerke</dc:creator>
      <dc:date>2023-01-31T10:58:28Z</dc:date>
    </item>
  </channel>
</rss>

