<?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: For Each Loop in iLogic Rule in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833304#M115277</link>
    <description>If you can post screenshots of the error windows that is always useful for us to diagnose what is wrong.&lt;BR /&gt;&lt;BR /&gt;For additional iLogic/vb.net info check out the blogs:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://beinginventive.typepad.com/being-inventive/" target="_blank"&gt;http://beinginventive.typepad.com/being-inventive/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://adndevblog.typepad.com/manufacturing/" target="_blank"&gt;http://adndevblog.typepad.com/manufacturing/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://modthemachine.typepad.com/my_weblog/" target="_blank"&gt;http://modthemachine.typepad.com/my_weblog/&lt;/A&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 25 Sep 2015 18:16:34 GMT</pubDate>
    <dc:creator>MechMachineMan</dc:creator>
    <dc:date>2015-09-25T18:16:34Z</dc:date>
    <item>
      <title>For Each Loop in iLogic Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833246#M115276</link>
      <description>&lt;P&gt;Hi. I am new in visual basic. I am trying to automatically create a list of parts that are changing dimensions by a parameter. So I need a for loop to change the parameter and save the file for each value in the list. &amp;nbsp;(this is just a first step, in second step I will create a nested loop.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to write a rule but it doesnt work. Can you help me?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;Next&lt;/SPAN&gt; 
    &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 17:42:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833246#M115276</guid>
      <dc:creator>ulasdeniz</dc:creator>
      <dc:date>2015-09-25T17:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: For Each Loop in iLogic Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833304#M115277</link>
      <description>If you can post screenshots of the error windows that is always useful for us to diagnose what is wrong.&lt;BR /&gt;&lt;BR /&gt;For additional iLogic/vb.net info check out the blogs:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://beinginventive.typepad.com/being-inventive/" target="_blank"&gt;http://beinginventive.typepad.com/being-inventive/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://adndevblog.typepad.com/manufacturing/" target="_blank"&gt;http://adndevblog.typepad.com/manufacturing/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://modthemachine.typepad.com/my_weblog/" target="_blank"&gt;http://modthemachine.typepad.com/my_weblog/&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Sep 2015 18:16:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833304#M115277</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-09-25T18:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: For Each Loop in iLogic Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833326#M115278</link>
      <description>&lt;P&gt;Thank you. the errors are in below When I delete the update and save as rows (last two rows before the Next statement) the rule works and model parameter is changing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/190830i169A7327F5516D75/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture_error.JPG" title="Capture_error.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/190831i3183F201737BF431/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture_error2.JPG" title="Capture_error2.JPG" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 19:04:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833326#M115278</guid>
      <dc:creator>ulasdeniz</dc:creator>
      <dc:date>2015-09-25T19:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: For Each Loop in iLogic Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833572#M115279</link>
      <description>As you can see i the second window, working from the bottom up, we see the issue goes from iLogic (which is the add-in) &amp;gt; ExecRuleInAssembly (The active assembly file) &amp;gt; Main (the rule in the assembly) &amp;gt; Document.SaveAs (A line/function trying to be performed by the Rule) &amp;gt; ForwardCall (the exact problem the program is running into).&lt;BR /&gt;&lt;BR /&gt;From the last 2 things listed (or the first 2 from the top in the window) we can see it is an issue with the same (why you see SaveAs in there) and an issue with something we don't know (forwardcall - upon research, you will find this actually has to do with calling an invalid variable as a parameter).&lt;BR /&gt;&lt;BR /&gt;From experience, the examples in the API help, and help in the forums, I have learned this specific situation is caused by the fact that you don't have the full file string listed in your saveas arguements. You need a string such as: "C:\Users\Bob\File.ipt"</description>
      <pubDate>Fri, 25 Sep 2015 21:24:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833572#M115279</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-09-25T21:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: For Each Loop in iLogic Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833591#M115280</link>
      <description>&lt;P&gt;Thank you. İt is solved as you stated. Full path name is rrequired. some functions doe not require the path name as using the current document path. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I have enother problem. My code is working, the parameters are changed. but the prametric flush constraint couldnt changed. I did everything. Document update. Add flush constraint's dimension into code and connected to the index parameter, placing update statement every row where the model is changed. But ı couldnt solved this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 21:51:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/5833591#M115280</guid>
      <dc:creator>ulasdeniz</dc:creator>
      <dc:date>2015-09-25T21:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: For Each Loop in iLogic Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/10006349#M115281</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;'This Is code for changing the parameters of components from an assembly.&lt;/SPAN&gt;
&lt;SPAN&gt;'If there Is no such parameter in the component, then the error Is ignored.&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oAsmDoc&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;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt;  &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; 
&lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;oAsmDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt; 

&lt;SPAN&gt;Parameter&lt;/SPAN&gt;.&lt;SPAN&gt;Quiet&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;occComp&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;
	&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;occComp&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;"d0"&lt;/SPAN&gt;) = &lt;SPAN&gt;d0&lt;/SPAN&gt;
	&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;occComp&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;"d1"&lt;/SPAN&gt;) = &lt;SPAN&gt;d1&lt;/SPAN&gt;
	&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;occComp&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;"d2"&lt;/SPAN&gt;) = &lt;SPAN&gt;d2&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;Parameter&lt;/SPAN&gt;.&lt;SPAN&gt;Quiet&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Jan 2021 15:31:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/for-each-loop-in-ilogic-rule/m-p/10006349#M115281</guid>
      <dc:creator>Z0methink</dc:creator>
      <dc:date>2021-01-16T15:31:33Z</dc:date>
    </item>
  </channel>
</rss>

