<?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 List Checks in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5841362#M358698</link>
    <description>&lt;P&gt;I'd like to find some iLogic code that will do three&amp;nbsp;things:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. I'd like some code that will check if a value is in a MultiValue parameter list (or an ArrayList variable).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using [list name].Contains([desired value]), but it always&amp;nbsp;returns false even if the value IS in the list. I've tried this with MultiValue parameters as well as ArrayList variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I'm using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;foundvalue&amp;nbsp;= MultiValue.FindValue("MultiValue.List("[list name]"), "=", [desired value])

If foundvalue = [desired value] Then
      'The value is in the MultiValue list
Else
      'The value is not in the MultiValue list
End If&lt;/PRE&gt;&lt;P&gt;It works, but I'd much rather&amp;nbsp;use a single line that will return true if it's in the list or false if it's&amp;nbsp;not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. I'd like some code that will compare two lists (whether MultiValue parameters or ArrayLists or mixed) and indicate if they are identical or not.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3. I'd like some code that will check if a Parameter is a MultiValue parameter at all.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2015 21:40:28 GMT</pubDate>
    <dc:creator>DRoam</dc:creator>
    <dc:date>2015-10-01T21:40:28Z</dc:date>
    <item>
      <title>iLogic List Checks</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5841362#M358698</link>
      <description>&lt;P&gt;I'd like to find some iLogic code that will do three&amp;nbsp;things:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. I'd like some code that will check if a value is in a MultiValue parameter list (or an ArrayList variable).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using [list name].Contains([desired value]), but it always&amp;nbsp;returns false even if the value IS in the list. I've tried this with MultiValue parameters as well as ArrayList variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I'm using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;foundvalue&amp;nbsp;= MultiValue.FindValue("MultiValue.List("[list name]"), "=", [desired value])

If foundvalue = [desired value] Then
      'The value is in the MultiValue list
Else
      'The value is not in the MultiValue list
End If&lt;/PRE&gt;&lt;P&gt;It works, but I'd much rather&amp;nbsp;use a single line that will return true if it's in the list or false if it's&amp;nbsp;not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. I'd like some code that will compare two lists (whether MultiValue parameters or ArrayLists or mixed) and indicate if they are identical or not.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3. I'd like some code that will check if a Parameter is a MultiValue parameter at all.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 21:40:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5841362#M358698</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2015-10-01T21:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic List Checks</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5841612#M358699</link>
      <description>&lt;P&gt;Hi DRoam,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you'll need to use a &lt;EM&gt;For Each&lt;/EM&gt; statement. Here are some links that contain examples:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/inventor-general-discussion/how-to-create-a-rule-in-ilogic/m-p/3419793#M432019" target="_blank"&gt;http://forums.autodesk.com/t5/inventor-general-discussion/how-to-create-a-rule-in-ilogic/m-p/3419793#M432019&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/inventor-general-discussion/how-to-remove-custom-iproperty-with-ilogic/m-p/4364841#M479447" target="_blank"&gt;http://forums.autodesk.com/t5/inventor-general-discussion/how-to-remove-custom-iproperty-with-ilogic/m-p/4364841#M479447&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://inventortrenches.blogspot.com/2014/03/ilogic-delete-custom-iproperties.html" target="_blank"&gt;http://inventortrenches.blogspot.com/2014/03/ilogic-delete-custom-iproperties.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If those don't help I'll try to look at this again tomorrow&amp;nbsp;as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 02:32:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5841612#M358699</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2015-10-02T02:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic List Checks</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842490#M358700</link>
      <description>&lt;P&gt;Thanks for the help, Curtis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still having the problem where the "contains" check always returns false, even if the value IS in the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the attached part (Inv 2016) that's exibiting this behavior for me. All it contains is a multivalue parameter with the values 1 through 3, and an iLogic rule that checks for the values 1 through 3. If it goes the same for you as for me, you'll see three messages pop up saying each value wasn't found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 15:22:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842490#M358700</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2015-10-02T15:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic List Checks</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842678#M358701</link>
      <description>&lt;P&gt;Hi DRoam,&lt;/P&gt;
&lt;P&gt;Can you post the iLogic code? I don't have 2016 installed on this system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 16:51:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842678#M358701</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2015-10-02T16:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic List Checks</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842734#M358702</link>
      <description>&lt;P&gt;Sure, sorry about that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim MyListVar As New ArrayList

MyListVar = MultiValue.List("MyListParam")

For i=1 To 3
	If MyListVar.Contains(i) Then
		MessageBox.Show("Success! Found the value """ &amp;amp; i &amp;amp; """ in the list!", "Success!",MessageBoxButtons.OK)
	Else
		MessageBox.Show("Failure! Value """ &amp;amp; i &amp;amp; """ not found in the list!", "Failure!",MessageBoxButtons.OK,MessageBoxIcon.Error)
	End If
Next i&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Oct 2015 17:16:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842734#M358702</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2015-10-02T17:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic List Checks</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842920#M358703</link>
      <description>&lt;P&gt;Ah, the lovely ‘gotchas’ of Multivalue Lists.&lt;BR /&gt;&lt;BR /&gt;Long story short, you’re looking for the wrong ‘type’ of value. Use the code below, and read the explanation just beyond for more learning and extra credit.&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Dim MyListVar As New ArrayList()
MyListVar = MultiValue.List("MyListParam")

For i=1 To 3
	''' UNCOMMENT THE BELOW CODE TO SEE THE 'TYPE'
	''' OF THE ACTUAL OBJECT STORED IN THE POSITION
	''' (i-1) OF THE MyListVar PARAMETER! 
	''MessageBox.Show(TypeName(MyListVar(i-1)))
	
	If MyListVar.Contains(CStr(i)) Then
		MessageBox.Show("Success! Found the value """ &amp;amp; i &amp;amp; """ in the list!", "Success!",MessageBoxButtons.OK)
	Else
		MessageBox.Show("Failure! Value """ &amp;amp; i &amp;amp; """ not found in the list!", "Failure!",MessageBoxButtons.OK,MessageBoxIcon.Error)
	End If
Next i&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Alright, so what that iLogic function isn’t telling you is that the ArrayList is being built from the ExpressionList object that is attached to the MultiValue Property.&lt;BR /&gt;&lt;BR /&gt;PICTURE TIME! :&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/192159i615014CC7E2A4A1F/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="MultiValueExpList.PNG" title="MultiValueExpList.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------------&lt;BR /&gt;&lt;BR /&gt;An Expression is a string that can be interpreted as just a mathematical value or formula that shakes down to a value, and so in this case, the ExpressionList is just a collection of String Objects (or Variants according to the debug window).&lt;BR /&gt;&lt;BR /&gt;What the ‘MultiValue.List(“Parameter”) does is take all of those Variant / String values, adds them to an ArrayList, and then sends that entire ArrayList back into whatever called it. In this case, it’s the MyListVar that you have declared.&lt;BR /&gt;&lt;BR /&gt;When you ask it to check whether or not the value of “i” is inside of that ArrayList, it looks for an INTEGER value because ‘i’ was assigned a numeric value at the start of the For loop. Because the ArrayList contains only Strings, it wouldn’t be able to find any match and would return false.&lt;BR /&gt;&lt;BR /&gt;Converting the value of ‘i’ into a String beforehand (as I have done in my code) clears up the issue! And now hopefully, this mystery should also be a bit more clear to you as well!&lt;BR /&gt;&lt;BR /&gt;-----------&lt;BR /&gt;&lt;BR /&gt;Question on my mind : Why would you like to search through the Multivalue list in this way? Are you worried about users inputting their own ‘non-standard’ values? Just curious&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 18:41:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842920#M358703</guid>
      <dc:creator>MegaJerk</dc:creator>
      <dc:date>2015-10-02T18:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic List Checks</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842947#M358704</link>
      <description>&lt;P&gt;Hi DRoam,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addtion to MegJerk's info, have a look at the attached file for some examples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 19:01:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-list-checks/m-p/5842947#M358704</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2015-10-02T19:01:01Z</dc:date>
    </item>
  </channel>
</rss>

