<?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 break curve at point in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/break-curve-at-point/m-p/5670911#M39652</link>
    <description>&lt;P&gt;I have a piece of code that breaks a polyline in two pieces:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PromptEntityOptions opt = new PromptEntityOptions(Environment.NewLine + "Select curve to break: ");&lt;BR /&gt; PromptEntityResult eres = ed.GetEntity(opt);&lt;/P&gt;
&lt;P&gt;if (eres.Status != PromptStatus.OK)&lt;BR /&gt; { &lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;var ent = ((Autodesk.AutoCAD.DatabaseServices.Entity)tr.GetObject(eres.ObjectId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead, false));&lt;/P&gt;
&lt;P&gt;List&amp;lt;double&amp;gt; pars = new List&amp;lt;double&amp;gt;();&lt;/P&gt;
&lt;P&gt;var curv = ((Autodesk.AutoCAD.DatabaseServices.Curve)tr.GetObject(ent.ObjectId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, false));&lt;/P&gt;
&lt;P&gt;PromptPointOptions opt1 = new PromptPointOptions(Environment.NewLine + "Enter the break point");&lt;BR /&gt; PromptPointResult res1 = ed.GetPoint(opt1);&lt;BR /&gt; Point3d p = curv.GetClosestPointTo(res1.Value, false);&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that I have to select first the polyline, then the breaking point. How can i do it in one shot (geting the point when picking the line)? Is this possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;emiz&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2015 22:18:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-09T22:18:52Z</dc:date>
    <item>
      <title>break curve at point</title>
      <link>https://forums.autodesk.com/t5/net-forum/break-curve-at-point/m-p/5670911#M39652</link>
      <description>&lt;P&gt;I have a piece of code that breaks a polyline in two pieces:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PromptEntityOptions opt = new PromptEntityOptions(Environment.NewLine + "Select curve to break: ");&lt;BR /&gt; PromptEntityResult eres = ed.GetEntity(opt);&lt;/P&gt;
&lt;P&gt;if (eres.Status != PromptStatus.OK)&lt;BR /&gt; { &lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;var ent = ((Autodesk.AutoCAD.DatabaseServices.Entity)tr.GetObject(eres.ObjectId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead, false));&lt;/P&gt;
&lt;P&gt;List&amp;lt;double&amp;gt; pars = new List&amp;lt;double&amp;gt;();&lt;/P&gt;
&lt;P&gt;var curv = ((Autodesk.AutoCAD.DatabaseServices.Curve)tr.GetObject(ent.ObjectId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, false));&lt;/P&gt;
&lt;P&gt;PromptPointOptions opt1 = new PromptPointOptions(Environment.NewLine + "Enter the break point");&lt;BR /&gt; PromptPointResult res1 = ed.GetPoint(opt1);&lt;BR /&gt; Point3d p = curv.GetClosestPointTo(res1.Value, false);&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that I have to select first the polyline, then the breaking point. How can i do it in one shot (geting the point when picking the line)? Is this possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;emiz&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2015 22:18:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/break-curve-at-point/m-p/5670911#M39652</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-09T22:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: break curve at point</title>
      <link>https://forums.autodesk.com/t5/net-forum/break-curve-at-point/m-p/5670942#M39653</link>
      <description>&lt;P&gt;Use the PromptEntityResult.PickedPoint property:&lt;/P&gt;
&lt;PRE&gt;                //PromptPointOptions opt1 = new PromptPointOptions(Environment.NewLine + "Enter the break point");
                //PromptPointResult res1 = ed.GetPoint(opt1);
                Point3d p = curv.GetClosestPointTo(eres.PickedPoint, false);
&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jun 2015 23:06:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/break-curve-at-point/m-p/5670942#M39653</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2015-06-09T23:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: break curve at point</title>
      <link>https://forums.autodesk.com/t5/net-forum/break-curve-at-point/m-p/5672518#M39654</link>
      <description>&lt;P&gt;Thank you Jeff, that works for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;emiz&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2015 19:09:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/break-curve-at-point/m-p/5672518#M39654</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-10T19:09:33Z</dc:date>
    </item>
  </channel>
</rss>

