<?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: How to make two polylines eachother. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783803#M9829</link>
    <description>&lt;P&gt;Sorry, my mistake. my code is followings.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static bool checkTwoPlineTouch(Polyline pl1, Polyline pl2)            // this checks two polyline is close.
        {
            bool btch = false;

            int tchcnt = 0;
            for (int i = 0; i &amp;lt; pl2.NumberOfVertices; i++)
            {
                if (IsPointOnPolyline(pl1, pl2.GetPoint3dAt(i)))
                {
                    tchcnt++;
                }
            }
            if (tchcnt &amp;gt;= 2)
                btch = true;
            tchcnt = 0;
            if (!btch)
            {
                for (int i = 0; i &amp;lt; pl1.NumberOfVertices; i++)
                {
                    if (IsPointOnPolyline(pl2, pl1.GetPoint3dAt(i)))
                    {
                        tchcnt++;
                    }
                }
                if (tchcnt &amp;gt;= 2)
                    btch = true;
            }
            return btch;
        }
 public static bool IsPointOnPolyline(Polyline pl, Point3d pt)           // this returns point is on polyline or not.
        {
            bool isOn = false;
            for (int i = 0; i &amp;lt; pl.NumberOfVertices; i++)
            {
                Curve3d seg = null;
                SegmentType segType = pl.GetSegmentType(i);
                if (segType == SegmentType.Arc)
                    seg = pl.GetArcSegmentAt(i);
                else
                if (segType == SegmentType.Line)
                    seg = pl.GetLineSegmentAt(i);
                if (seg != null)
                {
                    isOn = seg.IsOn(pt);      
                    //isOn=seg.
                    if (isOn)
                        break;
                }
            }
            return isOn;
        }&lt;/LI-CODE&gt;&lt;P&gt;Now moved point is lie on target polyline. But IsOnPolyline function returns false.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 09:29:03 GMT</pubDate>
    <dc:creator>MarkJamesRogolino</dc:creator>
    <dc:date>2023-02-27T09:29:03Z</dc:date>
    <item>
      <title>How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11769374#M9818</link>
      <description>&lt;P&gt;Hello, everyone. Now I have to make two polylines (these are separated each other) touch.Is there a way to implement this process&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 09:55:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11769374#M9818</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-21T09:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11770797#M9819</link>
      <description>&lt;P&gt;Please explain in detail.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 18:34:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11770797#M9819</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-02-21T18:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11771407#M9820</link>
      <description>&lt;P&gt;Hi, Kdub. Thanks for your reply. This is my problem.&lt;/P&gt;&lt;P&gt;If I have two poly lines in one document, I need to touch the two poly lines.&lt;BR /&gt;To do that, I have to stretch left polyline&amp;nbsp; to the right automatically. Is it possible?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="goldhorsemillion_0-1677042137253.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1179553i5D5FA9A1406FD0A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="goldhorsemillion_0-1677042137253.png" alt="goldhorsemillion_0-1677042137253.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 22:59:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11771407#M9820</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-21T22:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11771542#M9821</link>
      <description>&lt;P&gt;If you are sure the rectangular polylines will be in the orientation you show,&amp;nbsp;&lt;/P&gt;&lt;P&gt;perhaps :&lt;BR /&gt;change the RIGHT vertex locations.X of the left polyline to be the same as&lt;/P&gt;&lt;P&gt;the&amp;nbsp;&amp;nbsp;LEFT vertex locations.X of the right polyline.&lt;BR /&gt;&lt;BR /&gt;If your design differs, you will need to explain in detail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;added:&lt;BR /&gt;Any issues with the rectangles not being planar OR with the edges not being parallel will/may need to be handled.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;To do that, I have to stretch left polyline&amp;nbsp; to the right automatically. Is it possible? &amp;lt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What do you imagine will &lt;STRIKE&gt;initiale&lt;/STRIKE&gt;&amp;nbsp; initiate this functionality ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit 2023/02/25 : spelling&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 21:02:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11771542#M9821</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-02-24T21:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11778841#M9822</link>
      <description>&lt;P&gt;Hi, Kdub. How can I move point3d runtime?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 13:30:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11778841#M9822</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-24T13:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11779826#M9823</link>
      <description>&lt;P&gt;You can't move&amp;nbsp; a point3D.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;added : refer to your post :&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/net/how-to-get-an-objectid-of-a-point3d/m-p/11753625" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/net/how-to-get-an-objectid-of-a-point3d/m-p/11753625&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can relocate a Vertex :&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Polyline_SetPointAt_int_Point2d" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Polyline_SetPointAt_int_Point2d&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume you know how to iterate the vertex 's of a polyline and test for the vertex index with the largest ( or smallest ) X value.&lt;BR /&gt;&lt;BR /&gt;// - - -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know your use case, but another way to handle this is to ask the user to select the polyline segment to "move" and select the segment to align with.&lt;/P&gt;&lt;P&gt;You can determine the X value end vertex index of the endpoint of each segment and change the "moving" vertex locations accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;added:&lt;/P&gt;&lt;P&gt;This may require some google work for you, but you will learn a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 21:06:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11779826#M9823</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-02-24T21:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11782229#M9824</link>
      <description>&lt;P&gt;Hello, kdub. Have a good weekend?&lt;/P&gt;&lt;P&gt;Thanks for your hint. But I have got this error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="goldhorsemillion_0-1677441614421.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1181456i8AD7AADBA838D0FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="goldhorsemillion_0-1677441614421.png" alt="goldhorsemillion_0-1677441614421.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This error cause is BlockTableRecord.AppendEntity(Polyline).&lt;/P&gt;&lt;P&gt;How can I solve this problem?&lt;/P&gt;&lt;P&gt;I think it does not requires Appendentity method. Right?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2023 14:19:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11782229#M9824</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-26T14:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11782703#M9825</link>
      <description>&lt;P&gt;Without seeing the code we'll only be guessing.&lt;BR /&gt;&lt;BR /&gt;I'd guess you are trying to Add/Append a polyline twice into the database.&lt;BR /&gt;&lt;BR /&gt;You may be able to debug this by adding breakpoints in the editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2023 20:35:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11782703#M9825</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-02-26T20:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783203#M9826</link>
      <description>&lt;P&gt;Hi, kdub. Thanks for your help. I already move polyline's vertex correctly. But moved points are not on target polyline(target polyline segment's ison property is false).&lt;/P&gt;&lt;P&gt;Check function that one point is on polyline or not is als followings.&lt;BR /&gt;This function works correctly about other Polylines but does not work about moved polylines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static bool IsPointOnPolyline(Polyline pl, Point3d pt)           
        {
            bool isOn = false;
            for (int i = 0; i &amp;lt; pl.NumberOfVertices; i++)
            {
                Curve3d seg = null;
                SegmentType segType = pl.GetSegmentType(i);
                if (segType == SegmentType.Arc)
                    seg = pl.GetArcSegmentAt(i);
                else
                if (segType == SegmentType.Line)
                    seg = pl.GetLineSegmentAt(i);
                if (seg != null)
                {
                    isOn = seg.IsOn(pt);                    
                    if (isOn)
                        break;
                }
            }
            return isOn;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me to solve this? I need to have the point3d lie on the target polyline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 05:06:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783203#M9826</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-27T05:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783391#M9827</link>
      <description>&lt;P&gt;How to add this entity to blocktablerecord after moving point? Should I just save the document?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 06:06:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783391#M9827</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-27T06:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783742#M9828</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't help without seeing ALL the code.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You seem to do this a lot, expecting others to resolve your problems without sufficient information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 08:57:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783742#M9828</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-02-27T08:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783803#M9829</link>
      <description>&lt;P&gt;Sorry, my mistake. my code is followings.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static bool checkTwoPlineTouch(Polyline pl1, Polyline pl2)            // this checks two polyline is close.
        {
            bool btch = false;

            int tchcnt = 0;
            for (int i = 0; i &amp;lt; pl2.NumberOfVertices; i++)
            {
                if (IsPointOnPolyline(pl1, pl2.GetPoint3dAt(i)))
                {
                    tchcnt++;
                }
            }
            if (tchcnt &amp;gt;= 2)
                btch = true;
            tchcnt = 0;
            if (!btch)
            {
                for (int i = 0; i &amp;lt; pl1.NumberOfVertices; i++)
                {
                    if (IsPointOnPolyline(pl2, pl1.GetPoint3dAt(i)))
                    {
                        tchcnt++;
                    }
                }
                if (tchcnt &amp;gt;= 2)
                    btch = true;
            }
            return btch;
        }
 public static bool IsPointOnPolyline(Polyline pl, Point3d pt)           // this returns point is on polyline or not.
        {
            bool isOn = false;
            for (int i = 0; i &amp;lt; pl.NumberOfVertices; i++)
            {
                Curve3d seg = null;
                SegmentType segType = pl.GetSegmentType(i);
                if (segType == SegmentType.Arc)
                    seg = pl.GetArcSegmentAt(i);
                else
                if (segType == SegmentType.Line)
                    seg = pl.GetLineSegmentAt(i);
                if (seg != null)
                {
                    isOn = seg.IsOn(pt);      
                    //isOn=seg.
                    if (isOn)
                        break;
                }
            }
            return isOn;
        }&lt;/LI-CODE&gt;&lt;P&gt;Now moved point is lie on target polyline. But IsOnPolyline function returns false.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 09:29:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11783803#M9829</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-27T09:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11785747#M9830</link>
      <description>&lt;P&gt;It looks to me you've used&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.keanw.com/2012/01/testing-whether-a-point-is-on-an-autocad-polyline-using-net.html" target="_blank" rel="noopener"&gt;https://www.keanw.com/2012/01/testing-whether-a-point-is-on-an-autocad-polyline-using-net.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an "Improved version"&lt;/P&gt;&lt;P&gt;&lt;A href="https://through-the-interface.typepad.com/through_the_interface/2012/01/testing-whether-a-point-is-on-any-autocad-curve-using-net.html" target="_blank" rel="noopener"&gt;https://through-the-interface.typepad.com/through_the_interface/2012/01/testing-whether-a-point-is-on-any-autocad-curve-using-net.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you tested it by passing a polyline and a Point3d that you "KNOW" is exactly on the pline ??&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;Perhaps there is a rounding issue with the Point3d axis values ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't checked your code ( or the copy ) , just giving options for you to check.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 21:23:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11785747#M9830</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-02-27T21:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11787200#M9831</link>
      <description>&lt;P&gt;Thanks, I used&amp;nbsp;&lt;A href="https://www.keanw.com/2012/01/testing-whether-a-point-is-on-an-autocad-polyline-using-net.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.keanw.com/2012/01/testing-whether-a-point-is-on-an-autocad-polyline-using-net.html&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;But how can I get Curve from polyline?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IsPointOnCurveGDAP and&amp;nbsp;IsPointOnCurveGCP function use Curve entity as a parameter.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 11:52:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11787200#M9831</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-02-28T11:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11788357#M9832</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12396114"&gt;@MarkJamesRogolino&lt;/a&gt;&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;But how can I get Curve from polyline?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The Polyline class is derived from the Curve one, so all Curve members apply to Polyline. You should learn &lt;A href="https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/inheritance" target="_blank" rel="noopener"&gt;Inheritance&lt;/A&gt; which is one of the basics of OOP.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 19:01:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11788357#M9832</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-02-28T19:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11789336#M9833</link>
      <description>&lt;P&gt;I know already Inheritence of OOP. I mean how to get Curve(line segment) from polyline entity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static bool IsPointOnPolyline(Polyline pl, Point3d pt)           // this returns point is on polyline or not.
        {
            
            bool isOn = false;
            for (int i = 0; i &amp;lt; pl.NumberOfVertices; i++)
            {
                Curve3d seg = null;
                SegmentType segType = pl.GetSegmentType(i);
                if (segType == SegmentType.Arc)
                    seg = pl.GetArcSegmentAt(i);
                else
                if (segType == SegmentType.Line)
                    seg = pl.GetLineSegmentAt(i);
                if (seg != null)
                {
                    isOn = seg.IsOn(pt);      
                    //isOn= IsPointOnCurveGDAP(seg, pt);
                    if (isOn)
                        break;
                }
            }
            return isOn;
        }
private bool IsPointOnCurveGCP(Curve cv, Point3d pt)
        {
            try
            {
                Point3d p = cv.GetClosestPointTo(pt, false);
                return (p - pt).Length &amp;lt;= Tolerance.Global.EqualPoint;
            }
            catch { }
            return false;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here seg should be Curve type.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 04:57:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11789336#M9833</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-03-01T04:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11789463#M9834</link>
      <description>&lt;P&gt;Are not you confusing &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_DatabaseServices_Curve" target="_blank" rel="noopener"&gt;Curve&lt;/A&gt; and &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_Geometry_Curve3d" target="_blank" rel="noopener"&gt;Curve3d&lt;/A&gt;?&lt;/P&gt;
&lt;P&gt;Both methods you show work with a Polyline.&lt;/P&gt;
&lt;P&gt;IsPointOnPolyline(pline, point) should return the same result as IsPointOnCurveGCP(pline, point)&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 07:03:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11789463#M9834</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-03-01T07:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11789659#M9835</link>
      <description>&lt;P&gt;Hi, gile. In my opinion cv of&amp;nbsp;&lt;SPAN&gt;IsPointOnCurveGCP(Curve cv, point) function is linesegment of pline of&amp;nbsp;IsPointOnPolyline(pline, point). I want to get&amp;nbsp; curve as a linesegment of pline.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 09:04:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11789659#M9835</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-03-01T09:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11794350#M9836</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12396114"&gt;@MarkJamesRogolino&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;I want to get&amp;nbsp; curve as a linesegment of pline. &amp;lt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sorry, I can't understand those requitements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See if this helps your understanding :&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// (C) CodeHimBelonga: kdub 2023/03/03
//
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using System;

//using Kdub.Common;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Core.Application;

[assembly: CommandClass(typeof(TouchingPolylines.TestCommands_02))]

namespace TouchingPolylines
{
   public class TestCommands_02
   {
      private static Document _doc =&amp;gt; AcadApp.DocumentManager.MdiActiveDocument;
      private static Database _db =&amp;gt; _doc.Database;
      private static Editor _ed =&amp;gt; _doc.Editor;

      public static void WriteMessage(string msg) =&amp;gt; _ed.WriteMessage(msg);


      [CommandMethod("plSegment")]
      public static void PlineSegment()
      {
         PromptEntityOptions peo = new PromptEntityOptions("\nSelect a Polyline Segment: ");
         peo.SetRejectMessage("\nMust be a Polyline...");
         peo.AddAllowedClass(typeof(Polyline), true);
         PromptEntityResult per = _ed.GetEntity(peo);
         
         if (per.Status == PromptStatus.Cancel) return;
         using (Transaction tr = _doc.TransactionManager.StartTransaction())
         {
            var pline = (Polyline)per.ObjectId.GetObject(OpenMode.ForRead);
            var wcsPickedPoint = per.PickedPoint.TransformBy(_ed.CurrentUserCoordinateSystem);
            var pointOnPline = pline.GetClosestPointTo(wcsPickedPoint, false);
            var segmentIndex = (int)pline.GetParameterAtPoint(pointOnPline);

            if (pline.GetSegmentType(segmentIndex) == SegmentType.Line)
            {
               LineSegment2d segment = pline.GetLineSegment2dAt(segmentIndex);
               _ed.WriteMessage($"\nsegmentIndex: {segmentIndex}\n");
               _ed.WriteMessage($"segment Length: {segment.Length}\n");
               _ed.WriteMessage($"Angle: {( segment.Direction.Angle * 180 / Math.PI )}°\n" );
               _ed.WriteMessage($"Startpoint: {(segment.StartPoint)}\n");
            }
            else
            {
               _ed.WriteMessage($"\nsegment Type: {pline.GetSegmentType(segmentIndex)}\n");
            }
            tr.Commit();
         }
      }
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PolyLineSegment 2023-03-03_08-55-52.png" style="width: 946px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1183881i93139F6B27F8E1A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="PolyLineSegment 2023-03-03_08-55-52.png" alt="PolyLineSegment 2023-03-03_08-55-52.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 10:14:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11794350#M9836</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-03-03T10:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to make two polylines eachother.</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11795458#M9837</link>
      <description>&lt;P&gt;Thanks, kdub. I mean I should know one point is lie on one linesegment. I enclosed my working video.&lt;/P&gt;&lt;P&gt;As you can see in my video I moved two points to one Polyline. But my code returns two polylines are not touched eachother. Followings are my code.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;BlockTable acBlkTbl;
acBlkTbl = acCurrTrans.GetObject(db.BlockTableId, OpenMode.ForWrite) as BlockTable;
BlockTableRecord acBlkTblRec;
acBlkTblRec = acCurrTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace],OpenMode.ForWrite) as BlockTableRecord;
Point3d acPt3d = new Point3d(right1.X, 0, 0);
Vector3d acVec3d = acPt3d.GetVectorTo(new Point3d(left2.X, 0, 0));
for (int i = 0; i &amp;lt; pln1.NumberOfVertices; i++)
{
    Point3d pt = pln1.GetPoint3dAt(i);
    if (pt.X == right1.X)
    {
       pln1.SetPointAt(i, new Point2d(left2.X, pt.Y));
    }
}
bool istch = NBCrelate.checkTwoPlineTouch(pln2, pln1);
if (istch)
  Application.ShowAlertDialog("Two Polyline touched");
public static bool checkTwoPlineTouch(Polyline pl1, Polyline pl2)            // this checks two polyline is close.
        {
            bool btch = false;

            int tchcnt = 0;
            for (int i = 0; i &amp;lt; pl2.NumberOfVertices; i++)
            {
                if (IsPointOnPolyline(pl1, pl2.GetPoint3dAt(i)))
                {
                    tchcnt++;
                }
            }
            if (tchcnt &amp;gt;= 2)
                btch = true;
            tchcnt = 0;
            if (!btch)
            {
                for (int i = 0; i &amp;lt; pl1.NumberOfVertices; i++)
                {
                    if (IsPointOnPolyline(pl2, pl1.GetPoint3dAt(i)))
                    {
                        tchcnt++;
                    }
                }
                if (tchcnt &amp;gt;= 2)
                    btch = true;
            }
            return btch;
        }
public static bool IsPointOnPolyline(Polyline pl, Point3d pt)           // this returns point is on polyline or not.
        {            
            bool isOn = false;
            for (int i = 0; i &amp;lt; pl.NumberOfVertices; i++)
            {
                Curve3d seg = null;
                Curve seg1 = null;
                SegmentType segType = pl.GetSegmentType(i);
                if (segType == SegmentType.Arc)
                    seg = pl.GetArcSegmentAt(i);
                else
                if (segType == SegmentType.Line)
                    seg = pl.GetLineSegmentAt(i);
                    //seg1 = pl.GetLineSegment2dAt(i);
                if (seg != null)
                {
                    //isOn = seg.IsOn(pt);      
                    isOn= IsPointOnCurveGDAP(seg, pt);
                    if (isOn)
                        break;
                }
            }
            return isOn;
        }&lt;/LI-CODE&gt;&lt;P&gt;I saw moved Polyline's Point is equal to target polylines's left vertex X coordinate.&lt;/P&gt;&lt;P&gt;But&amp;nbsp;IsPointOnPolyline function does not return true. I dont know cause. Could you tell me?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 08:39:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-make-two-polylines-eachother/m-p/11795458#M9837</guid>
      <dc:creator>MarkJamesRogolino</dc:creator>
      <dc:date>2023-03-03T08:39:42Z</dc:date>
    </item>
  </channel>
</rss>

