<?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: trimming entities by polyline in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7075368#M31590</link>
    <description>&lt;P&gt;Surely there is solution or solutions with AutoCAD .NET API: programming/writing your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not knowing&amp;nbsp;you know what you have done with .NET API, you could write your app to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. identify the border curve (polyline, as you said). You may need to ask user to pick;&lt;/P&gt;
&lt;P&gt;2. Identify all possible target lines (on given layers; or ask user to select...) and then test each of these lines against the border polyline for interaction;&lt;/P&gt;
&lt;P&gt;after obtaining the interaction points, you can change the line's StartPoint/EndPoint accordingly, so that the line looks like "trimmed".&lt;/P&gt;
&lt;P&gt;3. If the target entity is not a Line, you need to do it differently. For example, if it is polyline, you may need to add/remove vertices; or create a new polyline and erase the old one, so that it looks like being trimmed.&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 18:53:21 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2017-05-10T18:53:21Z</dc:date>
    <item>
      <title>trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7074113#M31589</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I just registered in this forum and this is my first thread...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I just want to trim the poly&lt;/SPAN&gt;&lt;A href="http://www.cadtutor.net/forum/archive/index.php/t-65757.html?s=be730381bcd91fcf509bb68be580471d" target="_blank"&gt;lines&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;within a boundary.&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://www.cadtutor.net/forum/archive/index.php/t-65757.html?s=be730381bcd91fcf509bb68be580471d" target="_blank"&gt;Lines&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;must be trimmed exactly at the intersection of line and the &lt;/SPAN&gt;&lt;A href="http://www.cadtutor.net/forum/archive/index.php/t-65757.html?s=be730381bcd91fcf509bb68be580471d" target="_blank"&gt;rectangle&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is ther any solution with c# and autocad .NET ?&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 11:05:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7074113#M31589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-10T11:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7075368#M31590</link>
      <description>&lt;P&gt;Surely there is solution or solutions with AutoCAD .NET API: programming/writing your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not knowing&amp;nbsp;you know what you have done with .NET API, you could write your app to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. identify the border curve (polyline, as you said). You may need to ask user to pick;&lt;/P&gt;
&lt;P&gt;2. Identify all possible target lines (on given layers; or ask user to select...) and then test each of these lines against the border polyline for interaction;&lt;/P&gt;
&lt;P&gt;after obtaining the interaction points, you can change the line's StartPoint/EndPoint accordingly, so that the line looks like "trimmed".&lt;/P&gt;
&lt;P&gt;3. If the target entity is not a Line, you need to do it differently. For example, if it is polyline, you may need to add/remove vertices; or create a new polyline and erase the old one, so that it looks like being trimmed.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 18:53:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7075368#M31590</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2017-05-10T18:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7077260#M31591</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi norman, thank you for your answer, that's exactly what i did, it works if the entity is a line, but if it is a polyline the method&amp;nbsp;GetSplitCurves(pts) where pts are points of intersection of the two polylines (the boundary and the entity) give a wrong deviding !&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;below the code if the entity is a line : if there is one point of intersection how can i tho the part of the polyline that is inside the boundary to keep it ???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public static void IntersectTest()&lt;BR /&gt;{&lt;BR /&gt;Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;Database db = doc.Database;&lt;BR /&gt;Editor ed = doc.Editor;&lt;BR /&gt;using (Transaction tr = db.TransactionManager.StartTransaction())&lt;BR /&gt;{&lt;BR /&gt;using (DocumentLock lck = doc.LockDocument())&lt;BR /&gt;{&lt;BR /&gt;PromptEntityOptions peo = new PromptEntityOptions("\nSelect a Line &amp;gt;&amp;gt;");&lt;BR /&gt;peo.SetRejectMessage("\nYou have to select the Line only &amp;gt;&amp;gt;");&lt;BR /&gt;peo.AddAllowedClass(typeof(Line), false);&lt;BR /&gt;PromptEntityResult res;&lt;BR /&gt;res = ed.GetEntity(peo);&lt;BR /&gt;if (res.Status != PromptStatus.OK)&lt;BR /&gt;return;&lt;BR /&gt;Entity ent = (Entity)tr.GetObject(res.ObjectId, OpenMode.ForRead);&lt;BR /&gt;if (ent == null)&lt;BR /&gt;return;&lt;BR /&gt;Line line = (Line)ent as Line;&lt;BR /&gt;if (line == null) return;&lt;BR /&gt;peo = new PromptEntityOptions("\nSelect a Rectangle: ");&lt;BR /&gt;peo.SetRejectMessage("\nYou have to select the Polyline only &amp;gt;&amp;gt;");&lt;BR /&gt;peo.AddAllowedClass(typeof(Polyline), false);&lt;BR /&gt;res = ed.GetEntity("\nSelect a Rectangle: ");&lt;BR /&gt;if (res.Status != PromptStatus.OK)&lt;BR /&gt;return;&lt;BR /&gt;ent = (Entity)tr.GetObject(res.ObjectId, OpenMode.ForRead);&lt;BR /&gt;if (ent == null)&lt;BR /&gt;return;&lt;BR /&gt;Polyline pline = (Polyline)ent as Polyline;&lt;BR /&gt;if (line == null) return;&lt;BR /&gt;Point3dCollection pts = new Point3dCollection();&lt;BR /&gt;//pline.IntersectWith(line, Intersect.ExtendArgument, pts, 0, 0);&lt;BR /&gt;pline.IntersectWith(line, Intersect.OnBothOperands, pts, IntPtr.Zero, IntPtr.Zero);&lt;BR /&gt;if (pts.Count == 0) return;&lt;BR /&gt;DBObjectCollection lstobj = line.GetSplitCurves(pts);&lt;/P&gt;&lt;P&gt;BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);&lt;BR /&gt;Line ln0 = lstobj[1] as Line;// middle&lt;BR /&gt;Line ln1 = lstobj[0] as Line;&lt;/P&gt;&lt;P&gt;Line ln2 = lstobj[2] as Line;&lt;BR /&gt;if (!ln0.IsWriteEnabled)&lt;BR /&gt;ln0.UpgradeOpen();&lt;BR /&gt;btr.AppendEntity(ln0);&lt;BR /&gt;tr.AddNewlyCreatedDBObject(ln0, true);&lt;BR /&gt;if (!ln1.IsWriteEnabled)&lt;BR /&gt;ln1.UpgradeOpen();&lt;BR /&gt;ln1.Dispose();&lt;/P&gt;&lt;P&gt;if (!ln2.IsWriteEnabled)&lt;BR /&gt;ln2.UpgradeOpen();&lt;BR /&gt;ln2.Dispose();&lt;/P&gt;&lt;P&gt;if (!line.IsWriteEnabled)&lt;BR /&gt;line.UpgradeOpen();&lt;BR /&gt;line.Erase();&lt;BR /&gt;line.Dispose();&lt;BR /&gt;ed.Regen();&lt;BR /&gt;tr.Commit();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;below the code if the entity is a polyline : how can i get the write split ???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public static void Decouppolylinebypolyline()&lt;BR /&gt;{&lt;BR /&gt;Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;Database db = doc.Database;&lt;BR /&gt;Editor ed = doc.Editor;&lt;BR /&gt;using (Transaction tr = db.TransactionManager.StartTransaction())&lt;BR /&gt;{&lt;BR /&gt;using (DocumentLock lck = doc.LockDocument())&lt;BR /&gt;{&lt;BR /&gt;PromptEntityOptions peo = new PromptEntityOptions("\nSelect a Rectangle: ");&lt;BR /&gt;peo.SetRejectMessage("\nYou have to select the Polyline only &amp;gt;&amp;gt;");&lt;BR /&gt;peo.AddAllowedClass(typeof(Polyline), false);&lt;BR /&gt;PromptEntityResult res;&lt;BR /&gt;res = ed.GetEntity("\nSelect a Rectangle: ");&lt;BR /&gt;if (res.Status != PromptStatus.OK)&lt;BR /&gt;return;&lt;BR /&gt;Entity ent = (Entity)tr.GetObject(res.ObjectId, OpenMode.ForRead);&lt;BR /&gt;if (ent == null)&lt;BR /&gt;return;&lt;BR /&gt;Polyline pline1 = (Polyline)ent as Polyline;&lt;BR /&gt;if (!pline1.IsWriteEnabled)&lt;BR /&gt;{&lt;BR /&gt;pline1.UpgradeOpen();&lt;BR /&gt;}&lt;BR /&gt;pline1.Closed = true;&lt;/P&gt;&lt;P&gt;peo = new PromptEntityOptions("\nSelect a polyline : ");&lt;BR /&gt;peo.SetRejectMessage("\nYou have to select the Polyline only &amp;gt;&amp;gt;");&lt;BR /&gt;peo.AddAllowedClass(typeof(Polyline), false);&lt;BR /&gt;res = ed.GetEntity("\nSelect a polyline : ");&lt;BR /&gt;if (res.Status != PromptStatus.OK)&lt;BR /&gt;return;&lt;BR /&gt;ent = (Entity)tr.GetObject(res.ObjectId, OpenMode.ForRead);&lt;BR /&gt;if (ent == null)&lt;BR /&gt;return;&lt;BR /&gt;Polyline pline2 = (Polyline)ent as Polyline;&lt;BR /&gt;if (pline2 == null) return;&lt;BR /&gt;if (!pline2.IsWriteEnabled)&lt;BR /&gt;{&lt;BR /&gt;pline2.UpgradeOpen();&lt;BR /&gt;}&lt;BR /&gt;pline2.Closed = true;&lt;/P&gt;&lt;P&gt;Point3dCollection pts = new Point3dCollection();&lt;BR /&gt;pline2.IntersectWith(pline1, Intersect.OnBothOperands, pts, IntPtr.Zero, IntPtr.Zero);&lt;BR /&gt;if (pts.Count == 0) return;&lt;BR /&gt;MessageBox.Show("nbr pnts :" + pts.Count.ToString());&lt;BR /&gt;DBObjectCollection lstobj = pline2.GetSplitCurves(pts);&lt;BR /&gt;MessageBox.Show(lstobj.Count.ToString());&lt;/P&gt;&lt;P&gt;BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);&lt;BR /&gt;Polyline ln0 = lstobj[1] as Polyline;&lt;BR /&gt;Polyline ln1 = lstobj[0] as Polyline;&lt;BR /&gt;Polyline ln2 = lstobj[2] as Polyline;&lt;BR /&gt;Polyline ln3 = lstobj[3] as Polyline;&lt;/P&gt;&lt;P&gt;if (!ln0.IsWriteEnabled)&lt;BR /&gt;{&lt;BR /&gt;ln0.UpgradeOpen();&lt;BR /&gt;}&lt;BR /&gt;btr.AppendEntity(ln0);&lt;BR /&gt;tr.AddNewlyCreatedDBObject(ln0, true);&lt;/P&gt;&lt;P&gt;if (!ln1.IsWriteEnabled)&lt;BR /&gt;{&lt;BR /&gt;ln1.UpgradeOpen();&lt;BR /&gt;}&lt;BR /&gt;//ln1.Dispose();&lt;/P&gt;&lt;P&gt;btr.AppendEntity(ln1);&lt;BR /&gt;tr.AddNewlyCreatedDBObject(ln1, true);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if (!ln2.IsWriteEnabled)&lt;BR /&gt;{&lt;BR /&gt;ln2.UpgradeOpen();&lt;BR /&gt;}&lt;BR /&gt;//ln2.Dispose();&lt;BR /&gt;btr.AppendEntity(ln2);&lt;BR /&gt;tr.AddNewlyCreatedDBObject(ln2, true);&lt;/P&gt;&lt;P&gt;if (!ln3.IsWriteEnabled)&lt;BR /&gt;{&lt;BR /&gt;ln3.UpgradeOpen();&lt;BR /&gt;}&lt;BR /&gt;//ln3.Dispose();&lt;BR /&gt;btr.AppendEntity(ln3);&lt;BR /&gt;tr.AddNewlyCreatedDBObject(ln3, true);&lt;/P&gt;&lt;P&gt;pline2.Erase();&lt;BR /&gt;pline2.Dispose();&lt;/P&gt;&lt;P&gt;ed.Regen();&lt;BR /&gt;tr.Commit();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm waiting for you answer! is there a better solution??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 13:16:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7077260#M31591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-11T13:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7080885#M31592</link>
      <description>You are using the right method, but you must first sort the points you pass to GetSplitCurves() by each point's distance from the start of the curve.</description>
      <pubDate>Fri, 12 May 2017 19:04:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7080885#M31592</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-05-12T19:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7081840#M31593</link>
      <description>&lt;P&gt;Thank you for your answer, please how can i do that with an optimal method without&amp;nbsp;calculating every&amp;nbsp;&lt;SPAN&gt;point's distance&amp;nbsp;from the start of the curve, and then&amp;nbsp;compare distances to sort points, because i have a lot of polylines to split and they have a lot of points !!!!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 13:28:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7081840#M31593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-13T13:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7082370#M31594</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@soumaya.aitlasiri wrote:&lt;BR /&gt;&lt;P&gt;Thank you for your answer, please how can i do that with an optimal method without&amp;nbsp;calculating every&amp;nbsp;&lt;SPAN&gt;point's distance&amp;nbsp;from the start of the curve, and then&amp;nbsp;compare distances to sort points, because i have a lot of polylines to split and they have a lot of points !!!!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Below are a few extension methods for the Curve class that should do what you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.Geometry;

namespace Autodesk.AutoCAD.DatabaseServices
{
   /// &amp;lt;summary&amp;gt;
   /// Extension methods for the Curve class
   /// &amp;lt;/summary&amp;gt;
   
   public static class CurveExtensions
   {
      /// &amp;lt;summary&amp;gt;
      /// Returns a sequence of Point3d objects from the input argument
      /// ordered by each point's distance from the start of the curve
      /// on which the method is invoked. 
      /// 
      /// The input Point3dCollection must contain points that all lie
      /// on the Curve.
      /// 
      /// &amp;lt;/summary&amp;gt;
      /// &amp;lt;param name="curve"&amp;gt;the Curve on which the given points lie&amp;lt;/param&amp;gt;
      /// &amp;lt;param name="pointsOnCurve"&amp;gt;the collection of points that lie on the curve&amp;lt;/param&amp;gt;
      /// &amp;lt;returns&amp;gt;A sequence containing the input collection of points ordered
      /// by each point's distance from the start of the curve&amp;lt;/returns&amp;gt;.
      /// 
      ///

      public static IEnumerable&amp;lt;Point3d&amp;gt; OrderPointsOnCurve(this Curve curve, Point3dCollection pointsOnCurve)
      {
         if(curve == null)
            throw new ArgumentNullException("curve");
         if(pointsOnCurve == null)
            throw new ArgumentNullException("input");
         if(pointsOnCurve.Count == 0)
            return Enumerable.Empty&amp;lt;Point3d&amp;gt;();
         return
            pointsOnCurve.Cast&amp;lt;Point3d&amp;gt;().Distinct().OrderBy(p =&amp;gt; curve.GetDistAtPoint(p));
      }

      /// &amp;lt;summary&amp;gt;
      /// Returns the set of curve fragments produced by splitting the 
      /// input Curve at each point where it intersects the given Entity.
      /// &amp;lt;/summary&amp;gt;
      /// &amp;lt;param name="curve"&amp;gt;The Curve to generate fragments from&amp;lt;/param&amp;gt;
      /// &amp;lt;param name="entity"&amp;gt;The intersecting entity&amp;lt;/param&amp;gt;
      /// &amp;lt;returns&amp;gt;A DBObjectCollection containing 0 or more curve fragments&amp;lt;/returns&amp;gt;

      public static DBObjectCollection GetIntersectionCurves(this Curve curve, Entity entity)
      {
         if(curve == null)
            throw new ArgumentNullException("curve");
         if(entity == null)
            throw new ArgumentNullException("entity");
         Point3dCollection points = new Point3dCollection();
         curve.IntersectWith(entity, Intersect.OnBothOperands, points, IntPtr.Zero, IntPtr.Zero);
         if(points.Count &amp;gt; 0)
         {
            return curve.GetSplitCurves(new Point3dCollection(curve.OrderPointsOnCurve(points).ToArray()));
         }
         return new DBObjectCollection();
      }
   }
}&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 May 2017 02:42:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7082370#M31594</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-05-14T02:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7082803#M31595</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am grateful, thank you a lot... it will be very helpful for me.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 17:36:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7082803#M31595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-14T17:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7082942#M31596</link>
      <description>&lt;P&gt;Please, i need your help, now the split works very well, I need to know the parts of the curve inside the bounadry to delete wich are outside of it, and form by them a closed polyline.&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 21:02:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7082942#M31596</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-14T21:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7085301#M31597</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@soumaya.aitlasiri wrote:&lt;BR /&gt;&lt;P&gt;Please, i need your help, now the split works very well, I need to know the parts of the curve inside the bounadry to delete wich are outside of it, and form by them a closed polyline.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Find any point on each curve fragment that does not lie on a cutting edge (of the boundary), and check to see if the point is inside or outside of the boundary. If the point is outside the boundary, the curve fragment is also outside of it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 20:30:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7085301#M31597</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-05-15T20:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7086316#M31598</link>
      <description>&lt;P&gt;Thank you very much, but how can&amp;nbsp;i if&amp;nbsp;the point is on, and if it is inside or outside the boundary.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 09:40:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7086316#M31598</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-16T09:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7087385#M31599</link>
      <description>&lt;P&gt;I found another problem which is my boundary is a polyline 2D but the entity is a polyline3D, then the method intersectwith doesn't return any point.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 16:49:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7087385#M31599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-16T16:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7088077#M31600</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@soumaya.aitlasiri wrote:&lt;BR /&gt;&lt;P&gt;Thank you very much, but how can&amp;nbsp;i if&amp;nbsp;the point is on, and if it is inside or outside the boundary.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If your boundary is a rectangle aligned with the WCS, how difficult is it to determine if a point lies inside, on an edge, or outside the rectangle?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's a relatively simple problem that you should be able to solve yourself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 21:19:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7088077#M31600</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-05-16T21:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7088175#M31601</link>
      <description>&lt;P&gt;Ok I'm sorry, i'm a beginner with&amp;nbsp;autocad .NET that's why&amp;nbsp;i find&amp;nbsp;this kind of problem. thnk you for all your answers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 22:04:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7088175#M31601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-16T22:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7088540#M31602</link>
      <description>The problem has little to do with .NET programming or AutoCAD for that matter. It's a basic geometry problem, and is easy to solve. The lower-left and upper-right corner points of the rectangle can be used to check if the X and/or Y of the point lies in the X and Y ranges of the rectangle.</description>
      <pubDate>Wed, 17 May 2017 03:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7088540#M31602</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-05-17T03:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7089159#M31603</link>
      <description>&lt;P&gt;Thank you very much... i will do that. my issue now is that i have entities that are polyline3d and have a different Z&amp;nbsp;than the boundary, so i can't recuperate points of intersection between the entity and the boundary!! is there any solution to get these points and then split the entity like ignoring Z and verify intersection by only X and Y... can you help me please!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 09:56:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7089159#M31603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-17T09:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7091331#M31604</link>
      <description>&lt;P&gt;The IntersectWith() method has an overloaded version that takes a Plane as an argument.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you call that version, it will project both entiies into the plane, compute the&lt;/P&gt;&lt;P&gt;intersection points and project them back into the plane of the first entity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 22:00:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7091331#M31604</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-05-17T22:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7091428#M31605</link>
      <description>&lt;P&gt;that's what i realy need! do you have an example to do that please !&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 22:48:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7091428#M31605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-17T22:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7121863#M31606</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;&amp;nbsp; i want to ask you if it is possible to edit this&amp;nbsp;function to specify the first point of the sort, and having this point the first at the result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public static IEnumerable&amp;lt;Point3d&amp;gt; OrderPointsOnCurve(Curve curve, Point3dCollection pointsOnCurve)
        {
            if (curve == null)
                throw new ArgumentNullException("curve");
            if (pointsOnCurve == null)
                throw new ArgumentNullException("input");
            if (pointsOnCurve.Count == 0)
                return Enumerable.Empty&amp;lt;Point3d&amp;gt;();
            return
               pointsOnCurve.Cast&amp;lt;Point3d&amp;gt;().Distinct().OrderBy(p =&amp;gt; curve.GetDistAtPoint(p));
        }&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 10:19:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7121863#M31606</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-01T10:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7123029#M31607</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;&amp;nbsp; i want to ask you if it is possible to edit this&amp;nbsp;function to specify the first point of the sort, and having this point the first at the result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public static IEnumerable&amp;lt;Point3d&amp;gt; OrderPointsOnCurve(Curve curve, Point3dCollection pointsOnCurve)
        {
            if (curve == null)
                throw new ArgumentNullException("curve");
            if (pointsOnCurve == null)
                throw new ArgumentNullException("input");
            if (pointsOnCurve.Count == 0)
                return Enumerable.Empty&amp;lt;Point3d&amp;gt;();
            return
               pointsOnCurve.Cast&amp;lt;Point3d&amp;gt;().Distinct().OrderBy(p =&amp;gt; curve.GetDistAtPoint(p));
        }&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sorry, I don't quite understand what 'first point of the sort' means. &amp;nbsp;The sorting is by the distance of each point from the start of the curve. &amp;nbsp;If the points are not sorted that way, GetSplitCurves() will return overlapping curve segments. &amp;nbsp;If you really want to change the order, you can call .ToArray() on the result returned by the above function, which will return the result in an array, and you can change the order of the array elements.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 16:54:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7123029#M31607</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-06-01T16:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: trimming entities by polyline</title>
      <link>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7127921#M31608</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;&amp;nbsp;thank you a lot,&amp;nbsp;i will&amp;nbsp;change&amp;nbsp;&lt;SPAN&gt;the order of the array elements. you helped me very much thank you again.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jun 2017 17:34:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/trimming-entities-by-polyline/m-p/7127921#M31608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-04T17:34:43Z</dc:date>
    </item>
  </channel>
</rss>

