<?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: Cannot get intersection points for spline (with 'Intersect.ExtendThis') to boundary curve in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11897663#M9208</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp; thank for your reply .&lt;/P&gt;&lt;P&gt;By the way after i got the intersection point. I tried to extend spline to this point but Autocad prompt me&amp;nbsp;&lt;/P&gt;&lt;P&gt;"eGeneralModelingFailure" .&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (memCurv.ObjectId.ObjectClass.
    IsDerivedFrom(RXClass.GetClass(typeof(Spline))))
{
    //Cast curve to spline :
    Spline splObj = (Spline)memCurv;

    //Update curve to open :
    splObj.UpgradeOpen();

    //Define point to extend :
    Point3d extPnt;

    if (splObj.StartPoint.DistanceTo(per.PickedPoint) &amp;lt;
        splObj.EndPoint.DistanceTo(per.PickedPoint))
        extPnt = splObj.StartPoint;
    else
        extPnt = splObj.EndPoint;

    Vector3d extVt = splObj.GetFirstDerivative(extPnt);

    using (Line tempLine = new Line())
    {
        //Create plane 2d to convert 3d geometry -&amp;gt; 2d geometry :
        var normal = ed.CurrentUserCoordinateSystem.CoordinateSystem3d.Zaxis;
        var plane = new Plane(Point3d.Origin, normal);

        //Find intersection point :
        tempLine.StartPoint = extPnt;
        tempLine.EndPoint = PolarXYonUCS(extPnt, extVt.AngleOnPlane(plane), extVt.Length);
        intPnts.Clear();
        tempLine.IntersectWith(boCurveSeg, Intersect.ExtendBoth, intPnts, IntPtr.Zero, IntPtr.Zero);
        if (intPnts.Count == 0 || intPnts.Count &amp;gt; 1)
        {
            return;
        }
        
        //Extend spline to intersection point :
        try
        {
            splObj.Extend(false, intPnts[0]);
        }
        catch (System.Exception ex)
        {
            ed.WriteMessage($"\nError : {ex.Message}");
            return;
        }

    }
}&lt;/LI-CODE&gt;&lt;P&gt;Can you give me some ideas to fix this ?&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
    <pubDate>Sat, 15 Apr 2023 00:12:53 GMT</pubDate>
    <dc:creator>trithuongle</dc:creator>
    <dc:date>2023-04-15T00:12:53Z</dc:date>
    <item>
      <title>Cannot get intersection points for spline (with 'Intersect.ExtendThis') to boundary curve</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11890726#M9206</link>
      <description>&lt;P&gt;Hello every body, I have a question.&lt;/P&gt;&lt;P&gt;I want to find the intersection points between spline and boundary like below .&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="trithuongle_0-1681309057321.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1201485iFB91572E133172E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="trithuongle_0-1681309057321.png" alt="trithuongle_0-1681309057321.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In my code , i use 'Intersect.ExtendThis' , but it return no intersection points.&lt;/P&gt;&lt;P&gt;I tried to change it to 'Intersect.ExtendBoth' but it didn't work.&lt;/P&gt;&lt;P&gt;If i change curve to extend to another type of curve like arc or line or polyline . The function worked well.&lt;/P&gt;&lt;P&gt;I don't know why using with spline this problem is came out and how to fix this.&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//Check intersection with extending member curve :
                                memCurv.IntersectWith(boCurv, Intersect.ExtendThis , intPnts, IntPtr.Zero, IntPtr.Zero);

                                if (intPnts.Count == 0)
                                    //Skip to next entity :
                                    continue;
                                else
                                    //Call extend SubFunction :
                                    CmdTE_ExtendCurves(ed, tr, boCurv, memCurv, intPnts, stdPnt);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 14:24:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11890726#M9206</guid>
      <dc:creator>trithuongle</dc:creator>
      <dc:date>2023-04-12T14:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get intersection points for spline (with 'Intersect.ExtendThis') to boundary curve</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11890758#M9207</link>
      <description>&lt;P&gt;Consider using the &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-A48AD068-9868-4F7A-8A51-F72A358EBB09" target="_blank" rel="noopener"&gt;EndFitTangent&lt;/A&gt; function to define a line that can be used to define intersection with the boundary line.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 14:34:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11890758#M9207</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2023-04-12T14:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get intersection points for spline (with 'Intersect.ExtendThis') to boundary curve</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11897663#M9208</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp; thank for your reply .&lt;/P&gt;&lt;P&gt;By the way after i got the intersection point. I tried to extend spline to this point but Autocad prompt me&amp;nbsp;&lt;/P&gt;&lt;P&gt;"eGeneralModelingFailure" .&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (memCurv.ObjectId.ObjectClass.
    IsDerivedFrom(RXClass.GetClass(typeof(Spline))))
{
    //Cast curve to spline :
    Spline splObj = (Spline)memCurv;

    //Update curve to open :
    splObj.UpgradeOpen();

    //Define point to extend :
    Point3d extPnt;

    if (splObj.StartPoint.DistanceTo(per.PickedPoint) &amp;lt;
        splObj.EndPoint.DistanceTo(per.PickedPoint))
        extPnt = splObj.StartPoint;
    else
        extPnt = splObj.EndPoint;

    Vector3d extVt = splObj.GetFirstDerivative(extPnt);

    using (Line tempLine = new Line())
    {
        //Create plane 2d to convert 3d geometry -&amp;gt; 2d geometry :
        var normal = ed.CurrentUserCoordinateSystem.CoordinateSystem3d.Zaxis;
        var plane = new Plane(Point3d.Origin, normal);

        //Find intersection point :
        tempLine.StartPoint = extPnt;
        tempLine.EndPoint = PolarXYonUCS(extPnt, extVt.AngleOnPlane(plane), extVt.Length);
        intPnts.Clear();
        tempLine.IntersectWith(boCurveSeg, Intersect.ExtendBoth, intPnts, IntPtr.Zero, IntPtr.Zero);
        if (intPnts.Count == 0 || intPnts.Count &amp;gt; 1)
        {
            return;
        }
        
        //Extend spline to intersection point :
        try
        {
            splObj.Extend(false, intPnts[0]);
        }
        catch (System.Exception ex)
        {
            ed.WriteMessage($"\nError : {ex.Message}");
            return;
        }

    }
}&lt;/LI-CODE&gt;&lt;P&gt;Can you give me some ideas to fix this ?&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2023 00:12:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11897663#M9208</guid>
      <dc:creator>trithuongle</dc:creator>
      <dc:date>2023-04-15T00:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get intersection points for spline (with 'Intersect.ExtendThis') to boundary curve</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11897702#M9209</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9728092"&gt;@trithuongle&lt;/a&gt;&amp;nbsp;I'm sorry to say that I have no experience with .Net.&amp;nbsp; Autodesk sent me your post and thought I could help.&amp;nbsp; &amp;nbsp;Just to confirm,&amp;nbsp; intPnts is being calculated correctly and the issue is how to "stretch" the spline to this point?&amp;nbsp;&lt;/P&gt;&lt;P&gt;YOu might consider using something like&amp;nbsp;&amp;nbsp;&lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Spline_InsertControlPointAt_double_Point3d_double" target="_blank" rel="noopener"&gt;Spline.InsertControlPointAt&lt;/A&gt; Method but I don't see how you specify the inserted CV order with respect to the other CVs.&amp;nbsp; You want it to be the first or last CV.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2023 01:14:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11897702#M9209</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2023-04-15T01:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get intersection points for spline (with 'Intersect.ExtendThis') to boundary curve</title>
      <link>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11914469#M9210</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good afternoon , sorry for reply you late.&lt;/P&gt;&lt;P&gt;I think&amp;nbsp;&lt;SPAN&gt;intPnts&amp;nbsp; is being calculated right ,but the problem is i cannot apply method curve.extend() for spline.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your&amp;nbsp;suggestion about '&amp;nbsp;&lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Spline_InsertControlPointAt_double_Point3d_double&amp;amp;_ga=2.216276498.54139489.1682031509-317616347.1679061802" target="_blank" rel="noopener nofollow noreferrer"&gt;Spline.InsertControlPointAt&lt;/A&gt;&amp;nbsp;' . I'm trying with this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2023 07:58:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cannot-get-intersection-points-for-spline-with-intersect/m-p/11914469#M9210</guid>
      <dc:creator>trithuongle</dc:creator>
      <dc:date>2023-04-22T07:58:18Z</dc:date>
    </item>
  </channel>
</rss>

