<?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 Sort using 4th element? in Inventor Engineer-To-Order (Read-Only)</title>
    <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692050#M2037</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to sort a list using the 4th element?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sort(iList, :Ascending, key := :first)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;sort(iList, :Ascending, key := :second)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sort(iList, :Ascending, key := :third)&lt;/P&gt;&lt;P&gt;sort(iList, :Ascending, key := :&lt;FONT color="#FF0000"&gt;fourth&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luc&lt;/P&gt;</description>
    <pubDate>Thu, 08 Nov 2012 14:08:19 GMT</pubDate>
    <dc:creator>ludesroc</dc:creator>
    <dc:date>2012-11-08T14:08:19Z</dc:date>
    <item>
      <title>Sort using 4th element?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692050#M2037</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to sort a list using the 4th element?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sort(iList, :Ascending, key := :first)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;sort(iList, :Ascending, key := :second)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sort(iList, :Ascending, key := :third)&lt;/P&gt;&lt;P&gt;sort(iList, :Ascending, key := :&lt;FONT color="#FF0000"&gt;fourth&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luc&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 14:08:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692050#M2037</guid>
      <dc:creator>ludesroc</dc:creator>
      <dc:date>2012-11-08T14:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sort using 4th element?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692196#M2038</link>
      <description>&lt;P&gt;The key parameter takes any function.&amp;nbsp; So to sort the fourth you need to create a function that gets the fourth element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;sort(iList, :Ascending, key := :&lt;FONT color="#FF0000"&gt;fourth&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function &lt;FONT color="#FF0000"&gt;fourth&lt;/FONT&gt;(inList As List) As Any&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Return nth(4, inList)&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will also work in other functions, such as Find&lt;/P&gt;&lt;P&gt;Find(myValue, iList, key:=:&lt;FONT color="#FF0000"&gt;fourth&lt;/FONT&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 15:20:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692196#M2038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-08T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sort using 4th element?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692310#M2039</link>
      <description>&lt;P&gt;Thanks Farren! That's exactly was I was looking for!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I can I get this new function to remain in the functions list permanently?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="Functions.jpg" src="https://forums.autodesk.com/t5/image/serverpage/image-id/42196i6CCF05F7DC3107C6/image-size/medium?v=mpbl-1&amp;amp;px=-1" align="center" border="0" alt="Functions.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Luc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 15:58:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692310#M2039</guid>
      <dc:creator>ludesroc</dc:creator>
      <dc:date>2012-11-08T15:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sort using 4th element?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692354#M2040</link>
      <description>&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make the function system wide, place it in "C:\Program Files\Autodesk\Inventor ETO Components 2012\Library\UserLib" (adjust for your version of eto)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if you found my solution helpful I would appreciate any kudos you would like to give (Accept as Solution is great too).&amp;nbsp; The two of these are used as a part of the formula to determine a users' "Ranking" and I'd like to increase mine &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://forums.autodesk.com/t5/FAQ-How-To-Using-Autodesk/Kudos-New-April-18/m-p/2993368/highlight/true"&gt;http://forums.autodesk.com/t5/FAQ-How-To-Using-Autodesk/Kudos-New-April-18/m-p/2993368/highlight/true&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://forums.autodesk.com/t5/Autodesk-Discussion-Groups/How-Postings-Kudos-and-correct-answers-Equate-to-Rankings/m-p/3463612/highlight/true#M2287"&gt;http://forums.autodesk.com/t5/Autodesk-Discussion-Groups/How-Postings-Kudos-and-correct-answers-Equate-to-Rankings/m-p/3463612/highlight/true#M2287&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 16:18:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692354#M2040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-08T16:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sort using 4th element?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692368#M2041</link>
      <description>&lt;P&gt;Great! Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe one day I'll be a mentor as well&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luc&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 16:23:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692368#M2041</guid>
      <dc:creator>ludesroc</dc:creator>
      <dc:date>2012-11-08T16:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sort using 4th element?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692992#M2042</link>
      <description>&lt;P&gt;Farren's answer is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep in mind though that the fourth function he wrote , using nth(4, mylist) does not work in the same way that first,second and third do, nth(4,{3,2,1}) returns 1 (i.e. the last element of the list), thirst({3,2}) returns novalue.&amp;nbsp; No difference if your lists have the correct number of entities of course.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Elly &lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 22:52:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3692992#M2042</guid>
      <dc:creator>ebachrach</dc:creator>
      <dc:date>2012-11-08T22:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sort using 4th element?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3694298#M2048</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The function below will cause it to work the same as :first, :second, and :third.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Function&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;fourth&lt;/FONT&gt;&lt;SPAN&gt;(inList As List) As Any&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; If length(inlist) &amp;lt; 4 then&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return NoValue&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Else&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return nth(4, inList)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; End If&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2012 18:50:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/sort-using-4th-element/m-p/3694298#M2048</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-09T18:50:47Z</dc:date>
    </item>
  </channel>
</rss>

