<?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: How to compare Items in a Item List with Fabrication API? in Fabrication CADmep Forum</title>
    <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-compare-items-in-a-item-list-with-fabrication-api/m-p/8241482#M3496</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about (remember that the item number is actually a string, not an integer):&lt;BR /&gt;&lt;BR /&gt;1. Get all item numbers of a known value of 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var items = Job.Items.Where(x =&amp;gt; x.Number == "1").ToList();&lt;/PRE&gt;
&lt;P&gt;2. Get all item numbers of a known value of 1 and where the CID is equal to 2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var items = Job.Items.Where(x =&amp;gt; x.Number == "1" &amp;amp;&amp;amp; x.CID == 2).ToList();&lt;/PRE&gt;
&lt;P&gt;3.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var items = Job.Items.Where(x =&amp;gt; x.CID == 2).ToList();

            foreach (Item value in items)
            {
                 if (value.Number == "1")
                 {
                     // item number of 1
                 }
             //do stuff
            } &lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Does that help at all?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Sep 2018 10:40:43 GMT</pubDate>
    <dc:creator>jazpearson</dc:creator>
    <dc:date>2018-09-03T10:40:43Z</dc:date>
    <item>
      <title>How to compare Items in a Item List with Fabrication API?</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-compare-items-in-a-item-list-with-fabrication-api/m-p/8220473#M3488</link>
      <description>&lt;PRE&gt; List&amp;lt;Item&amp;gt; lstTrans = Job.Items.Where(x =&amp;gt; x.CID == 2).ToList();

            foreach (Item value in lstTrans)
            {
             //do stuff
            } &lt;/PRE&gt;&lt;P&gt;I use that to do stuff when needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to be able to compare items within the list. I want to be able to find identical Item Numbers then make comparisons when needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g. if there are two Items with an Item number of 30, I want to then compare these two items to one another.&amp;nbsp; I know what I need to do.&amp;nbsp; I just want to know the easiest way to compare items in one list...&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 18:39:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-compare-items-in-a-item-list-with-fabrication-api/m-p/8220473#M3488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-23T18:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare Items in a Item List with Fabrication API?</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-compare-items-in-a-item-list-with-fabrication-api/m-p/8241482#M3496</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about (remember that the item number is actually a string, not an integer):&lt;BR /&gt;&lt;BR /&gt;1. Get all item numbers of a known value of 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var items = Job.Items.Where(x =&amp;gt; x.Number == "1").ToList();&lt;/PRE&gt;
&lt;P&gt;2. Get all item numbers of a known value of 1 and where the CID is equal to 2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var items = Job.Items.Where(x =&amp;gt; x.Number == "1" &amp;amp;&amp;amp; x.CID == 2).ToList();&lt;/PRE&gt;
&lt;P&gt;3.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var items = Job.Items.Where(x =&amp;gt; x.CID == 2).ToList();

            foreach (Item value in items)
            {
                 if (value.Number == "1")
                 {
                     // item number of 1
                 }
             //do stuff
            } &lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Does that help at all?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 10:40:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-compare-items-in-a-item-list-with-fabrication-api/m-p/8241482#M3496</guid>
      <dc:creator>jazpearson</dc:creator>
      <dc:date>2018-09-03T10:40:43Z</dc:date>
    </item>
  </channel>
</rss>

