<?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: sort points by different UCS in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/sort-points-by-different-ucs/m-p/9572989#M19373</link>
    <description>&lt;P&gt;I think it should have been:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Matrix3d xform = ed.CurrentUserCoordinateSystem.Inverse();
Point3dCollection punten2 = new Point3dCollection(
    punten
    .Cast&amp;lt;Point3d&amp;gt;()
    .OrderBy(point =&amp;gt; point.TranformBy(xform).X)
    .ToArray());&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 10 Jun 2020 21:16:32 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2020-06-10T21:16:32Z</dc:date>
    <item>
      <title>sort points by different UCS</title>
      <link>https://forums.autodesk.com/t5/net-forum/sort-points-by-different-ucs/m-p/9572831#M19371</link>
      <description>&lt;P&gt;Guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if this can be done:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Found this code once to sort a point3dcollection on their x-coordinate:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;            Point3dCollection punten2 = new Point3dCollection(
            punten
            .Cast&amp;lt;Point3d&amp;gt;()
            .OrderBy(point =&amp;gt; point.X)
            .ToArray());&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What is needed now is to sort the points on their position in a different UCS.&amp;nbsp;&lt;BR /&gt;However, their original value's need to stay the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Purpose is placing a RotatedDimension.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible to do? Can u give me any direction?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 20:06:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sort-points-by-different-ucs/m-p/9572831#M19371</guid>
      <dc:creator>stefanveurink68AXD</dc:creator>
      <dc:date>2020-06-10T20:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: sort points by different UCS</title>
      <link>https://forums.autodesk.com/t5/net-forum/sort-points-by-different-ucs/m-p/9572946#M19372</link>
      <description>&lt;P&gt;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Point3dCollection punten2 = new Point3dCollection(
            punten
            .Cast&amp;lt;Point3d&amp;gt;()
            .OrderBy(point =&amp;gt; point.X.TranformedBy(ed.CurrentUserCoordinateSystem))
            .ToArray());&lt;/LI-CODE&gt;
&lt;P&gt;I believe calling TransformedBy() in the .OrderBy clause would not change the points in the collection themselves, it only calculates the transform value for sorting, because Point3d is value type, not reference type. That is, Point3d.TransformBy() returns a new Point3d, the original Point3d is not changed, only a copy of it is passed into TransformBy() method. On the other hand. Entity.TransformedBy() is void method, that is, TransformedBy() is applied to the Entity itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 20:57:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sort-points-by-different-ucs/m-p/9572946#M19372</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2020-06-10T20:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: sort points by different UCS</title>
      <link>https://forums.autodesk.com/t5/net-forum/sort-points-by-different-ucs/m-p/9572989#M19373</link>
      <description>&lt;P&gt;I think it should have been:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Matrix3d xform = ed.CurrentUserCoordinateSystem.Inverse();
Point3dCollection punten2 = new Point3dCollection(
    punten
    .Cast&amp;lt;Point3d&amp;gt;()
    .OrderBy(point =&amp;gt; point.TranformBy(xform).X)
    .ToArray());&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Jun 2020 21:16:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sort-points-by-different-ucs/m-p/9572989#M19373</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2020-06-10T21:16:32Z</dc:date>
    </item>
  </channel>
</rss>

