<?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: isInside Query for a closed AcGePolyline2d in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/isinside-query-for-a-closed-acgepolyline2d/m-p/311278#M39823</link>
    <description>I believe the typical geometric way to do this is to count the number of&lt;BR /&gt;
times a ray drawn from the point crosses the polygon.  If the count is odd,&lt;BR /&gt;
it is inside the polygon.&lt;BR /&gt;
&lt;BR /&gt;
This is what I would start with -&lt;BR /&gt;
&lt;BR /&gt;
bool isPointInside(AcDbPolyline* pPolyline, AcGePoint3d testPnt)&lt;BR /&gt;
{&lt;BR /&gt;
    AcGePoint3dArray pnts;&lt;BR /&gt;
    AcDbRay ray;&lt;BR /&gt;
    ray.setBasePoint(testPnt);&lt;BR /&gt;
    if(Acad::eOk != pPolyline-&amp;gt;intersectWith(&amp;amp;ray, AcDb::kOnBothOperands,&lt;BR /&gt;
pnts))&lt;BR /&gt;
        return false;&lt;BR /&gt;
    return (pnts.length() % 2 != 0);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
    |&lt;BR /&gt;
----+----------------------------------------------&lt;BR /&gt;
    |  Byron Blattel&lt;BR /&gt;
    |  CADwerx---Applications for AutoCAD&lt;BR /&gt;
    |  Autodesk Registered Developer&lt;BR /&gt;
    |  email: byron@cadwerx.net&lt;BR /&gt;
    |  web site: http://www.cadwerx.net&lt;BR /&gt;
    |&lt;BR /&gt;
&lt;BR /&gt;
"Jens Scheffler" &lt;JSCHEFFLER&gt; wrote in message&lt;BR /&gt;
news:96C2E747DD1F6799265D7A27581DAAA2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hi there,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I need to detect if a input point lies inside a closed AcGePolyline2d or&lt;BR /&gt;
&amp;gt; not, (like the AcGeCircArc2d::isInside function) but a dont find any&lt;BR /&gt;
similar&lt;BR /&gt;
&amp;gt; funktion in AcGeCircArc2d and its base-classes or I dont find it. Please&lt;BR /&gt;
&amp;gt; message me if you know how i can detect if a input point lies inside a&lt;BR /&gt;
&amp;gt; closed AcGePolyline2d.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thank you !!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Jens&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/JSCHEFFLER&gt;</description>
    <pubDate>Fri, 09 Aug 2002 12:35:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-08-09T12:35:37Z</dc:date>
    <item>
      <title>isInside Query for a closed AcGePolyline2d</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/isinside-query-for-a-closed-acgepolyline2d/m-p/311276#M39821</link>
      <description>Hi there,&lt;BR /&gt;
&lt;BR /&gt;
I need to detect if a input point lies inside a closed AcGePolyline2d or&lt;BR /&gt;
not, (like the AcGeCircArc2d::isInside function) but a dont find any similar&lt;BR /&gt;
funktion in AcGeCircArc2d and its base-classes or I dont find it. Please&lt;BR /&gt;
message me if you know how i can detect if a input point lies inside a&lt;BR /&gt;
closed AcGePolyline2d.&lt;BR /&gt;
&lt;BR /&gt;
Thank you !!&lt;BR /&gt;
&lt;BR /&gt;
Jens</description>
      <pubDate>Thu, 08 Aug 2002 22:53:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/isinside-query-for-a-closed-acgepolyline2d/m-p/311276#M39821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-08T22:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: isInside Query for a closed AcGePolyline2d</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/isinside-query-for-a-closed-acgepolyline2d/m-p/311277#M39822</link>
      <description>Maybe you can draw a point entity and try to see if it is include in the&lt;BR /&gt;
polygon (with SSGet for example), just get the pointlist of the polyline and&lt;BR /&gt;
then :&lt;BR /&gt;
&lt;BR /&gt;
// Select crossing entities&lt;BR /&gt;
acedSSGet("_CP", pointlist, NULL, NULL, ssname);&lt;BR /&gt;
or&lt;BR /&gt;
// Select entities in polygonal window&lt;BR /&gt;
acedSSGet("_WP", pointlist, NULL, NULL, ssname);&lt;BR /&gt;
...&lt;BR /&gt;
acutRelRb(pointlist);&lt;BR /&gt;
// Test if the point is in the Selection set&lt;BR /&gt;
if (acedSSMember(pt, ssname) == RTNORM) then&lt;BR /&gt;
{&lt;BR /&gt;
    ...&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
this is the simplest way i think ... if there is not function for it of&lt;BR /&gt;
course &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Jens Scheffler" &lt;JSCHEFFLER&gt; a écrit dans le message de news:&lt;BR /&gt;
96C2E747DD1F6799265D7A27581DAAA2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hi there,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I need to detect if a input point lies inside a closed AcGePolyline2d or&lt;BR /&gt;
&amp;gt; not, (like the AcGeCircArc2d::isInside function) but a dont find any&lt;BR /&gt;
similar&lt;BR /&gt;
&amp;gt; funktion in AcGeCircArc2d and its base-classes or I dont find it. Please&lt;BR /&gt;
&amp;gt; message me if you know how i can detect if a input point lies inside a&lt;BR /&gt;
&amp;gt; closed AcGePolyline2d.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thank you !!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Jens&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/JSCHEFFLER&gt;</description>
      <pubDate>Fri, 09 Aug 2002 06:30:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/isinside-query-for-a-closed-acgepolyline2d/m-p/311277#M39822</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-09T06:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: isInside Query for a closed AcGePolyline2d</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/isinside-query-for-a-closed-acgepolyline2d/m-p/311278#M39823</link>
      <description>I believe the typical geometric way to do this is to count the number of&lt;BR /&gt;
times a ray drawn from the point crosses the polygon.  If the count is odd,&lt;BR /&gt;
it is inside the polygon.&lt;BR /&gt;
&lt;BR /&gt;
This is what I would start with -&lt;BR /&gt;
&lt;BR /&gt;
bool isPointInside(AcDbPolyline* pPolyline, AcGePoint3d testPnt)&lt;BR /&gt;
{&lt;BR /&gt;
    AcGePoint3dArray pnts;&lt;BR /&gt;
    AcDbRay ray;&lt;BR /&gt;
    ray.setBasePoint(testPnt);&lt;BR /&gt;
    if(Acad::eOk != pPolyline-&amp;gt;intersectWith(&amp;amp;ray, AcDb::kOnBothOperands,&lt;BR /&gt;
pnts))&lt;BR /&gt;
        return false;&lt;BR /&gt;
    return (pnts.length() % 2 != 0);&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
    |&lt;BR /&gt;
----+----------------------------------------------&lt;BR /&gt;
    |  Byron Blattel&lt;BR /&gt;
    |  CADwerx---Applications for AutoCAD&lt;BR /&gt;
    |  Autodesk Registered Developer&lt;BR /&gt;
    |  email: byron@cadwerx.net&lt;BR /&gt;
    |  web site: http://www.cadwerx.net&lt;BR /&gt;
    |&lt;BR /&gt;
&lt;BR /&gt;
"Jens Scheffler" &lt;JSCHEFFLER&gt; wrote in message&lt;BR /&gt;
news:96C2E747DD1F6799265D7A27581DAAA2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hi there,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I need to detect if a input point lies inside a closed AcGePolyline2d or&lt;BR /&gt;
&amp;gt; not, (like the AcGeCircArc2d::isInside function) but a dont find any&lt;BR /&gt;
similar&lt;BR /&gt;
&amp;gt; funktion in AcGeCircArc2d and its base-classes or I dont find it. Please&lt;BR /&gt;
&amp;gt; message me if you know how i can detect if a input point lies inside a&lt;BR /&gt;
&amp;gt; closed AcGePolyline2d.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thank you !!&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Jens&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/JSCHEFFLER&gt;</description>
      <pubDate>Fri, 09 Aug 2002 12:35:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/isinside-query-for-a-closed-acgepolyline2d/m-p/311278#M39823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-09T12:35:37Z</dc:date>
    </item>
  </channel>
</rss>

