<?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: Intersection of two ModelItemCollection objects in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7177917#M4544</link>
    <description>&lt;P&gt;Yes, this is a standard LINQ method which assumes that used collections have implemented IEqualityComparer. Maybe I can redefine my questions - I have a ModelItemCollection as an input and I'm using Navisworks Search API upon that collection. I need a collection which contains model items which weren't found by the current search.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2017 06:56:52 GMT</pubDate>
    <dc:creator>rade_tomovic</dc:creator>
    <dc:date>2017-06-26T06:56:52Z</dc:date>
    <item>
      <title>Intersection of two ModelItemCollection objects</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7176800#M4540</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there any built-in method which can return only model items contained in both ModelItemCollection-s (something like the intersection of two sets)? If not, what is the best way to achieve this? I was thinking about HashSet&amp;lt;ModelItemCollection&amp;gt; in order to use built-in HashSet logical operations, but I'm not quite sure how Navisworks Equals method works (or&amp;nbsp;ValueEquals or whatever similar I've found in the API) so any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 10:27:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7176800#M4540</guid>
      <dc:creator>rade_tomovic</dc:creator>
      <dc:date>2017-06-25T10:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of two ModelItemCollection objects</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7176804#M4541</link>
      <description>&lt;P&gt;I'd try the built in Intersect of ModelItemCollection to start with, and if it doesn't work definitly hashset but using the modelitem&amp;nbsp;InstanceHashCode.&lt;/P&gt;
&lt;P&gt;Might be able to use the InstanceHashCode in lambda with the built in intersect too.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 10:37:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7176804#M4541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-25T10:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of two ModelItemCollection objects</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7176838#M4542</link>
      <description>&lt;P&gt;There is no built-in method for the intersection, which will return a collection of intersected items, as far as I know.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 12:14:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7176838#M4542</guid>
      <dc:creator>rade_tomovic</dc:creator>
      <dc:date>2017-06-25T12:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of two ModelItemCollection objects</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7177239#M4543</link>
      <description>&lt;P&gt;I have an extension method from Linq showing up. Don't know how it would do performance wise.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 21:54:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7177239#M4543</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-25T21:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of two ModelItemCollection objects</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7177917#M4544</link>
      <description>&lt;P&gt;Yes, this is a standard LINQ method which assumes that used collections have implemented IEqualityComparer. Maybe I can redefine my questions - I have a ModelItemCollection as an input and I'm using Navisworks Search API upon that collection. I need a collection which contains model items which weren't found by the current search.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 06:56:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7177917#M4544</guid>
      <dc:creator>rade_tomovic</dc:creator>
      <dc:date>2017-06-26T06:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of two ModelItemCollection objects</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7178283#M4545</link>
      <description>&lt;P&gt;throwing a couple ideas to explore:&lt;/P&gt;
&lt;P&gt;1. I have used modelitem as key of dictionary in the past fairly efficiently so I assume they do implement some comparison method (not sure what dictionary use)...&lt;/P&gt;
&lt;P&gt;2. have you tried running the opposite search on the same set (negating the right conditions)?&lt;/P&gt;
&lt;P&gt;3. there is an invert method on collection so if you create a collection of the result and inverse that, it should give you the rest&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 08:54:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7178283#M4545</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-26T08:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of two ModelItemCollection objects</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7178323#M4546</link>
      <description>&lt;P&gt;Thanks for the ideas, I will try the first and/or the second. Model item (as well as almost every object in programming) implements &lt;EM&gt;&lt;STRONG&gt;Equals&lt;/STRONG&gt; &lt;/EM&gt;method, which should return true if both model items pointing to the same reference (memory location). Regarding the 3rd one, &lt;EM&gt;&lt;STRONG&gt;Invert&lt;/STRONG&gt; &lt;/EM&gt;method works only in a way to return invert selection using Navisworks document as an input, not the specific part (what I need here).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 09:02:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/intersection-of-two-modelitemcollection-objects/m-p/7178323#M4546</guid>
      <dc:creator>rade_tomovic</dc:creator>
      <dc:date>2017-06-26T09:02:03Z</dc:date>
    </item>
  </channel>
</rss>

