<?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: Compare items in list&amp;lt;dbcollection&amp;gt; if the same? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971287#M13579</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Your question is not clear.&lt;/P&gt;
&lt;P&gt;You should clarify what you want to achieve.&lt;/P&gt;
&lt;P&gt;The type "Dbcollection" does not exist in the API.&lt;/P&gt;
&lt;P&gt;What is the type of an item in ListA? a polyline? a list of polylines?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Feb 2022 07:16:17 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2022-02-25T07:16:17Z</dc:date>
    <item>
      <title>Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10961887#M13577</link>
      <description>&lt;P&gt;I have a &lt;STRONG&gt;ListA&lt;/STRONG&gt;&amp;nbsp;- List&amp;lt;Dbcollection&amp;gt; with each item is a group of polylines (polyline have some property: Length, Xdata…):&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;List&amp;lt;Dbcollection&amp;gt; :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;0 - {poly1, &amp;nbsp;poly2, poly3…},&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 - {poly1, &amp;nbsp;poly2, poly3, poly4…},&lt;/P&gt;&lt;P&gt;2 - {poly1, &amp;nbsp;poly2, poly3…}&amp;nbsp;…)&lt;/P&gt;&lt;P&gt;I would like to compare whether each item in &lt;STRONG&gt;ListA&lt;/STRONG&gt; is the same together or not? Please help me how to do that.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 03:38:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10961887#M13577</guid>
      <dc:creator>BIM_VIET</dc:creator>
      <dc:date>2022-02-21T03:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10970033#M13578</link>
      <description>&lt;P&gt;Any help?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 15:20:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10970033#M13578</guid>
      <dc:creator>BIM_VIET</dc:creator>
      <dc:date>2022-02-24T15:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971287#M13579</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Your question is not clear.&lt;/P&gt;
&lt;P&gt;You should clarify what you want to achieve.&lt;/P&gt;
&lt;P&gt;The type "Dbcollection" does not exist in the API.&lt;/P&gt;
&lt;P&gt;What is the type of an item in ListA? a polyline? a list of polylines?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 07:16:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971287#M13579</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2022-02-25T07:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971477#M13580</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The type of ListA is List&amp;lt;DBObjectCollection&amp;gt;, DBObjectCollection is List of Polylines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 09:39:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971477#M13580</guid>
      <dc:creator>BIM_VIET</dc:creator>
      <dc:date>2022-02-25T09:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971570#M13581</link>
      <description>&lt;P&gt;OK, now you have to clarify what do you mean with: "I would like to compare whether each item in &lt;STRONG&gt;ListA&lt;/STRONG&gt; is the same together or not?"&lt;/P&gt;
&lt;P&gt;Do you want to evaluate if two DBObjectCollection contains the same DBObjects (Polylines)? in the same order?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 10:40:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971570#M13581</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2022-02-25T10:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971602#M13582</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, that's what I want&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 11:00:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971602#M13582</guid>
      <dc:creator>BIM_VIET</dc:creator>
      <dc:date>2022-02-25T11:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971617#M13583</link>
      <description>&lt;P&gt;Does the order of polyline in the collection matters?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 11:05:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971617#M13583</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2022-02-25T11:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Compare items in list&lt;dbcollection&gt; if the same?</title>
      <link>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971677#M13584</link>
      <description>&lt;P&gt;If the order of polylines in the collections does not matter, this shoul do the trick.&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;private static bool ContentsEqual(DBObjectCollection collection1, DBObjectCollection collection2) =&amp;gt; 
        collection1.Count != collection2.Count &amp;amp;&amp;amp;
        !collection1.Cast&amp;lt;DBObject&amp;gt;().Except(collection2.Cast&amp;lt;DBObject&amp;gt;()).Any();&lt;/LI-CODE&gt;
&lt;P&gt;If the order matters use this instaed.&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;private static bool OrderedContentsEqual(DBObjectCollection collection1, DBObjectCollection collection2)
{
    if (collection1.Count != collection2.Count)
        return false;
    for (int i = 0; i &amp;lt; collection1.Count; i++)
    {
        if (collection1[i] != collection2[i])
            return false;
    }
    return true;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 11:28:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/compare-items-in-list-lt-dbcollection-gt-if-the-same/m-p/10971677#M13584</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2022-02-25T11:28:11Z</dc:date>
    </item>
  </channel>
</rss>

