<?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 Inserting the same part multiple times with the same constraints in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inserting-the-same-part-multiple-times-with-the-same-constraints/m-p/11592734#M145941</link>
    <description>&lt;P&gt;Hello!&lt;BR /&gt;I have a part that I need to insert into the assembly multiple times. Every time I insert this part, I need to make two constraints: the Z axis (Mate) and the XY plane (Flush).&lt;/P&gt;&lt;P&gt;Basically, I need to insert multiple occurrences of the same part, but with the same two constraints. The other constraints are different and I cannot use pattern.&lt;/P&gt;&lt;P&gt;I have found relatively simple code for constraining one instance of this part. But it will not work if I insert the same part multiple times because of the "occurence" number (marked with red) beside the part name.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;BR /&gt;Constraints.AddMate("Mate:1", "PartA:1", "Z Axis", "", "Z Axis",)&lt;BR /&gt;Constraints.AddFlush("Flush:1", "PartA:1", "XY Plane", "", "XY Plane")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried to use only "" instead of part name, but that didn't work.&lt;/P&gt;&lt;P&gt;Would it be possible to use iLogic to automate this process?&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 08:46:30 GMT</pubDate>
    <dc:creator>Odalv</dc:creator>
    <dc:date>2022-12-02T08:46:30Z</dc:date>
    <item>
      <title>Inserting the same part multiple times with the same constraints</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inserting-the-same-part-multiple-times-with-the-same-constraints/m-p/11592734#M145941</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;I have a part that I need to insert into the assembly multiple times. Every time I insert this part, I need to make two constraints: the Z axis (Mate) and the XY plane (Flush).&lt;/P&gt;&lt;P&gt;Basically, I need to insert multiple occurrences of the same part, but with the same two constraints. The other constraints are different and I cannot use pattern.&lt;/P&gt;&lt;P&gt;I have found relatively simple code for constraining one instance of this part. But it will not work if I insert the same part multiple times because of the "occurence" number (marked with red) beside the part name.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;BR /&gt;Constraints.AddMate("Mate:1", "PartA:1", "Z Axis", "", "Z Axis",)&lt;BR /&gt;Constraints.AddFlush("Flush:1", "PartA:1", "XY Plane", "", "XY Plane")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried to use only "" instead of part name, but that didn't work.&lt;/P&gt;&lt;P&gt;Would it be possible to use iLogic to automate this process?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 08:46:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inserting-the-same-part-multiple-times-with-the-same-constraints/m-p/11592734#M145941</guid>
      <dc:creator>Odalv</dc:creator>
      <dc:date>2022-12-02T08:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting the same part multiple times with the same constraints</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inserting-the-same-part-multiple-times-with-the-same-constraints/m-p/11592755#M145942</link>
      <description>&lt;P&gt;Try using for/next statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;i&lt;/SPAN&gt; = 1 &lt;SPAN&gt;To&lt;/SPAN&gt; 10
	&lt;SPAN&gt;Constraints&lt;/SPAN&gt;.&lt;SPAN&gt;AddMate&lt;/SPAN&gt;(&lt;SPAN&gt;"Mate:"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;i&lt;/SPAN&gt;, &lt;SPAN&gt;"PartA:"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;i&lt;/SPAN&gt;, &lt;SPAN&gt;"Z Axis"&lt;/SPAN&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;"Z Axis"&lt;/SPAN&gt;,)
	&lt;SPAN&gt;Constraints&lt;/SPAN&gt;.&lt;SPAN&gt;AddFlush&lt;/SPAN&gt;(&lt;SPAN&gt;"Flush:"&lt;/SPAN&gt; &amp;amp; i, &lt;SPAN&gt;"PartA:"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;i&lt;/SPAN&gt;, &lt;SPAN&gt;"XY Plane"&lt;/SPAN&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;"XY Plane"&lt;/SPAN&gt;)
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Dec 2022 08:56:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inserting-the-same-part-multiple-times-with-the-same-constraints/m-p/11592755#M145942</guid>
      <dc:creator>Cadkunde.nl</dc:creator>
      <dc:date>2022-12-02T08:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting the same part multiple times with the same constraints</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inserting-the-same-part-multiple-times-with-the-same-constraints/m-p/11592774#M145946</link>
      <description>&lt;P&gt;Brilliant! That was exactly what I need!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 09:05:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inserting-the-same-part-multiple-times-with-the-same-constraints/m-p/11592774#M145946</guid>
      <dc:creator>Odalv</dc:creator>
      <dc:date>2022-12-02T09:05:23Z</dc:date>
    </item>
  </channel>
</rss>

