<?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 iLogic in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10714912#M130544</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stuck using inventor iLogic, I understand the action I want iLogic to perform but I am unsure of how to make it do what I want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am designing a headbox for one of our products, the headbox has a standard size of 210mmH x 210mmW. However, the headbox changes in size depending on the size of other components (the guides).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The rule i have created so far looks like this:&lt;/P&gt;&lt;P&gt;If structural_opening_width = &amp;lt; 2500 Then&amp;nbsp;&lt;/P&gt;&lt;P&gt;headbox_depth = 125&lt;/P&gt;&lt;P&gt;headbox_length - 150&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue seems to be with the &amp;lt; sign. Can anyone advise on how to make this work so that if the structural opening is less than 2500 then the part will change to the sizes detailed above?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next issue to tackle will be that the next size of the headbox is between two sizes, the code might look like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If structural_opening_width =&amp;nbsp; 2501&amp;gt;x&amp;lt;5000 Then&amp;nbsp;&lt;/P&gt;&lt;P&gt;headbox_depth = 150&lt;/P&gt;&lt;P&gt;headbox_length - 150&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;</description>
    <pubDate>Tue, 26 Oct 2021 15:49:25 GMT</pubDate>
    <dc:creator>jamie.nelson.cubex</dc:creator>
    <dc:date>2021-10-26T15:49:25Z</dc:date>
    <item>
      <title>iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10714912#M130544</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stuck using inventor iLogic, I understand the action I want iLogic to perform but I am unsure of how to make it do what I want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am designing a headbox for one of our products, the headbox has a standard size of 210mmH x 210mmW. However, the headbox changes in size depending on the size of other components (the guides).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The rule i have created so far looks like this:&lt;/P&gt;&lt;P&gt;If structural_opening_width = &amp;lt; 2500 Then&amp;nbsp;&lt;/P&gt;&lt;P&gt;headbox_depth = 125&lt;/P&gt;&lt;P&gt;headbox_length - 150&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue seems to be with the &amp;lt; sign. Can anyone advise on how to make this work so that if the structural opening is less than 2500 then the part will change to the sizes detailed above?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next issue to tackle will be that the next size of the headbox is between two sizes, the code might look like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If structural_opening_width =&amp;nbsp; 2501&amp;gt;x&amp;lt;5000 Then&amp;nbsp;&lt;/P&gt;&lt;P&gt;headbox_depth = 150&lt;/P&gt;&lt;P&gt;headbox_length - 150&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 15:49:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10714912#M130544</guid>
      <dc:creator>jamie.nelson.cubex</dc:creator>
      <dc:date>2021-10-26T15:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10715007#M130545</link>
      <description>&lt;P&gt;So you aren't using the less than or equal to correctly. See modified code below:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If structural_opening_width &amp;lt;= 2500 'less than or equal to
	headbox_depth = 125
	headbox_length = 150
Else If structural_opening_width &amp;lt;= 5000 'less than or equal to, but does not match the first condition
	headbox_depth = 125
	headbox_length = 150
Else 'None of the conditions matched. Some people don't like using this kind of statement, but it's fine for this kind of aplication
	
End If&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added comments to help clarify things, but and if statement will step through each chaeck and act on the first match.&amp;nbsp; So the first condition is opening being less than or equal to 2500, if that fails it checks the next condition, in this case it is opening is less than or equal to 5000. [and failed the first condition, so the opening is greater than 2500]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You keep adding Else If [condition] for each condition you want to check, then you can either end there or add an open Else "Condition", which is only entered if none of the previous condtions work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any other questions feel free to ask.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 16:22:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10715007#M130545</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2021-10-26T16:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10716801#M130568</link>
      <description>&lt;P&gt;Thanks, that seems to have sorted out the initial issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I have run into another problem. I need to add more If statements that will modify the size of the headbox (i have attached the table below to detail what is required). I have created the following code that seems to work for the first four statements, but the sizes do not change as they should.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better code what i need?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; 	&lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;lt;=2500 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;lt;=1500
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 125
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 150
	
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;gt;2500.01 &amp;lt;5000 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;lt;=1500
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 150
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 150
	
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;lt;=2500 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;1500.01 &amp;lt;3000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 150
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 150
	
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;gt;2500.01 &amp;lt;5000  &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;1500.0 &amp;lt;3000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 180
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 180

&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;lt;= 2500 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;3000.01 &amp;lt;6000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 180
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 180

&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;gt;2500.01 &amp;lt;5000 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;3000.01 &amp;lt;6000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 210
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 210
	
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;lt;= 2500 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;6000.01 &amp;lt;9000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 210
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 210
	
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;gt;2500.01 &amp;lt;5000 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;6000.01 &amp;lt;9000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 230
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 230
	
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;lt;= 2500 &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;9000.01 &amp;lt;12000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 230
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 230

&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;s_o_width&lt;/SPAN&gt; &amp;gt;2500.01 &amp;lt;5000 &lt;SPAN&gt;Andalso&lt;/SPAN&gt; &lt;SPAN&gt;s_o_height&lt;/SPAN&gt; &amp;gt;9000.01 &amp;lt;12000
	&lt;SPAN&gt;headbox_depth&lt;/SPAN&gt; = 250
	&lt;SPAN&gt;headbox_length&lt;/SPAN&gt; = 250
	
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 09:59:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10716801#M130568</guid>
      <dc:creator>jamie.nelson.cubex</dc:creator>
      <dc:date>2021-10-27T09:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10717234#M130575</link>
      <description>&lt;P&gt;This would be a good one to use nested If Statements:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'Nesting If Statements Example:

If s_o_width &amp;lt;= 2500 'If Level 1
	
	If  s_o_height &amp;lt;= 1500 'If Level 2-A
		headbox_depth = 125
		headbox_length = 150
		
	Else If s_o_height &amp;lt;= 3000 'Else If Level 2-A
		headbox_depth = 150
		headbox_length = 150
		
	Else If s_o_height &amp;lt;= 6000 'Else If Level 2-A
		headbox_depth = 180
		headbox_length = 180
		
	Else If s_o_height &amp;lt;= 9000 'Else If Level 2-A	
		headbox_depth = 210
		headbox_length = 210
		
	Else If s_o_height &amp;lt;= 12000 'Else If Level 2-A	
		headbox_depth = 230
		headbox_length = 230
		
	Else 'Else Level 2-A
		MessageBox.Show("s_o_height is Greater than 12000")
		
	End If	'End Level 2-A
	
Else If s_o_width &amp;lt; 5000 'Else If Level 1
	
	If  s_o_height &amp;lt;= 1500 'If Level 2-B
		headbox_depth = 150
		headbox_length = 150
		
	Else If s_o_height &amp;lt;= 3000 'Else If Level 2-B
		headbox_depth = 180
		headbox_length = 180
		
	Else If s_o_height &amp;lt;= 6000 'Else If Level 2-B
		headbox_depth = 210
		headbox_length = 210
		
	Else If s_o_height &amp;lt;= 9000 'Else If Level 2-B	
		headbox_depth = 230
		headbox_length = 230
		
	Else If s_o_height &amp;lt;= 12000 'Else If Level 2-B	
		headbox_depth = 250
		headbox_length = 250
		
	Else 'Else Level 2-B
		MessageBox.Show("s_o_height is Greater than 12000")
		
	End If	'End Level 2-B
	
Else 'Else Level 1
	MessageBox.Show("s_o_width is Greater than 5000")
	
End If 'End Level 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If level 1 handles the 2 width options and then there is a level 2 if statement in each to handle the 5 height options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any questions, or if this is not working as intended&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 12:49:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic/m-p/10717234#M130575</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2021-10-27T12:49:08Z</dc:date>
    </item>
  </channel>
</rss>

