<?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: bug of intersectWith() in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6986583#M8480</link>
    <description>&lt;P&gt;It's a problem with my AutoCAD. It works with other version.&lt;/P&gt;&lt;P&gt;There is no problem with the code.&lt;/P&gt;&lt;P&gt;Thank you so much for your replies&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2017 07:46:17 GMT</pubDate>
    <dc:creator>syx_lemans</dc:creator>
    <dc:date>2017-03-31T07:46:17Z</dc:date>
    <item>
      <title>bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6975878#M8471</link>
      <description>&lt;P&gt;I used these methods above to check entities' intersection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;AcDbEntity* selectEntity(const ACHAR* prompt,
                         AcDbObjectId&amp;amp; id,
                         AcGePoint3d&amp;amp; pick,
                         AcDb::OpenMode openMode )
{
    AcDbEntity* ent = NULL;
    ads_name ename;
    
    if(acedEntSel(prompt, ename, asDblArray(pick) ) == RTNORM)
    {
        if(acdbGetObjectId(id,ename)==Acad::eOk)
            {
            if(acdbOpenAcDbEntity(ent,id,openMode)==Acad::eOk)
                return ent;
            }
    }
    return ent;
}

void Test()
{
    // TODO: Implement the command
    AcDbEntity* pEnt1;
    AcDbEntity* pEnt2;
    AcGePoint3d pick;
    AcDbObjectId id;
    Acad::ErrorStatus es;
    AcGePoint3dArray is;
    
    if((pEnt1 = selectEntity(_T("\nSelect 1st entity : "),
                             id,pick,AcDb::kForRead))== NULL)
    {
        acutPrintf(L"\nSelection failed");
        return;
    }
    
    if((pEnt2 = selectEntity(_T("\nSelect 2nd entity : "),
                             id,pick,AcDb::kForRead))== NULL)
    {
        acutPrintf(_T("\nSelection failed"));
        pEnt1-&amp;gt;close();
        return;
    }
    
    es = pEnt1-&amp;gt;intersectWith(pEnt2,AcDb::kOnBothOperands,is);
    
    if(es != Acad::eOk)
    {
        acutPrintf(_T("\nIntersectWith failed : es = %s"),
                   acadErrorStatusText(es));
    }
    else
    {
        acutPrintf(_T("\nGot %d intersections"),is.length());
        for(int i= 0;i&amp;lt;is.length();i++)
            {
            acutPrintf(_T("\nIntersection[%d] :(%.3lf,%.3lf,%3.lf)"),
                       i,is[i].x,is[i].y,is[i].z);
            }
    }
    pEnt1-&amp;gt;close();
    pEnt2-&amp;gt;close();
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;When I selection two entities with no intersection, it works well. However, when I take two entities with intersection, it crashes. It's apparently a issue from the intersectWith method., but I don't know why.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 14:54:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6975878#M8471</guid>
      <dc:creator>syx_lemans</dc:creator>
      <dc:date>2017-03-27T14:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6975965#M8472</link>
      <description>&lt;P&gt;I can not reproduce your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//-----------------------------------------------------------------------------
//----- acrxEntryPoint.cpp
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"

//-----------------------------------------------------------------------------
#define szRDS _RXST("")

//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class CTestIntersectApp : public AcRxArxApp {

public:
	CTestIntersectApp () : AcRxArxApp () {}

	virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
		AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg (pkt) ;
		return (retCode) ;
	}

	virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
		AcRx::AppRetCode retCode = AcRxArxApp::On_kUnloadAppMsg (pkt) ;
		return (retCode) ;
	}

	virtual void RegisterServerComponents () {	}

  static AcDbEntity* selectEntity(const ACHAR* prompt,
    AcDbObjectId&amp;amp; id,
    AcGePoint3d&amp;amp; pick,
    AcDb::OpenMode openMode)
  {
    AcDbEntity* ent = NULL;
    ads_name ename;

    if (acedEntSel(prompt, ename, asDblArray(pick)) == RTNORM)
    {
      if (acdbGetObjectId(id, ename) == Acad::eOk)
      {
        if (acdbOpenAcDbEntity(ent, id, openMode) == Acad::eOk)
          return ent;
      }
    }
    return ent;
  }

	static void MyGroupMyCommand () {
    AcDbEntity* pEnt1;
    AcDbEntity* pEnt2;
    AcGePoint3d pick;
    AcDbObjectId id;
    Acad::ErrorStatus es;
    AcGePoint3dArray is;

    if ((pEnt1 = selectEntity(_T("\nSelect 1st entity : "),
      id, pick, AcDb::kForRead)) == NULL)
    {
      acutPrintf(L"\nSelection failed");
      return;
    }

    if ((pEnt2 = selectEntity(_T("\nSelect 2nd entity : "),
      id, pick, AcDb::kForRead)) == NULL)
    {
      acutPrintf(_T("\nSelection failed"));
      pEnt1-&amp;gt;close();
      return;
    }

    es = pEnt1-&amp;gt;intersectWith(pEnt2, AcDb::kOnBothOperands, is);

    if (es != Acad::eOk)
    {
      acutPrintf(_T("\nIntersectWith failed : es = %s"),
        acadErrorStatusText(es));
    }
    else
    {
      acutPrintf(_T("\nGot %d intersections"), is.length());
      for (int i = 0;i &amp;lt; is.length();i++)
      {
        acutPrintf(_T("\nIntersection[%d]: (%.3lf,%.3lf,%3.lf)"),
          i, is[i].x, is[i].y, is[i].z);
      }
    }
    pEnt1-&amp;gt;close();
    pEnt2-&amp;gt;close();
	}

	
} ;

//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CTestIntersectApp)

ACED_ARXCOMMAND_ENTRY_AUTO(CTestIntersectApp, MyGroup, MyCommand, MyCommandLocal, ACRX_CMD_MODAL, NULL)

&lt;/PRE&gt;
&lt;P&gt;Video:&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;
&lt;DIV class="iframe-container"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/d5625137-d833-4394-afbf-7a503294a717" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;" width="640" height="620" frameborder="0"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;
&lt;DIV class="iframe-container"&gt;1. What AutoCAD version you using? Have you all updates installed?&lt;/DIV&gt;
&lt;DIV class="iframe-container"&gt;2. What ObjectARX SDK version you using?&lt;/DIV&gt;
&lt;DIV class="iframe-container"&gt;3. What Visual Studio version you using?&lt;/DIV&gt;
&lt;DIV class="iframe-container"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:20:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6975965#M8472</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-03-27T15:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6977729#M8473</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I am using objectarx2011 and AutoCAD 2011. Perhaps it's too old.&lt;/P&gt;&lt;P&gt;When I ran the code, I got an issue:&lt;/P&gt;&lt;PRE&gt;acrxEntryPoint.cpp(71): error C2248: 'AcDbEntity::subIntersectWith' : cannot access protected member declared in class 'AcDbEntity'&lt;/PRE&gt;&lt;P&gt;And I found this in "sdk_map_names.h":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 484px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/338346i8350F34AC148A96B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So I comment this line. Then it's compiled successfully.&lt;/P&gt;&lt;P&gt;But it crashed when I picked two intersecting lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 07:58:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6977729#M8473</guid>
      <dc:creator>syx_lemans</dc:creator>
      <dc:date>2017-03-28T07:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6979492#M8474</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4492778"&gt;@syx_lemans&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your reply.&lt;/P&gt;
&lt;P&gt;I am using objectarx2011 and AutoCAD 2011. Perhaps it's too old.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I can not check with AutoCAD 2011 but can recommend install all updates and check again:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/support/autocad/downloads?release=2011" target="_blank"&gt;https://knowledge.autodesk.com/support/autocad/downloads?release=2011&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:50:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6979492#M8474</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-03-28T18:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6980549#M8475</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4492778"&gt;@syx_lemans&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I am using objectarx2011 and AutoCAD 2011.&lt;/P&gt;
&lt;P&gt;When I ran the code, I got an issue:&lt;/P&gt;
&lt;PRE&gt;acrxEntryPoint.cpp(71): error C2248: 'AcDbEntity::subIntersectWith' : cannot access protected member declared in class 'AcDbEntity'&lt;/PRE&gt;
&lt;P&gt;And I found this in "sdk_map_names.h":&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 484px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/338346i8350F34AC148A96B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So I comment this line. Then it's compiled successfully.&lt;/P&gt;
&lt;P&gt;But it crashed when I picked two intersecting lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suppose you implemented your own custom entity class. I also suppose you have ported your project from a pre-ARX2010 version.&lt;/P&gt;
&lt;P&gt;Starting with ARX 2010 many of the virtual &lt;FONT face="courier new,courier"&gt;AcDbEntity&lt;/FONT&gt; methods (like &lt;FONT face="courier new,courier"&gt;subIntersectWith()&lt;/FONT&gt;) became&amp;nbsp; &lt;FONT face="courier new,courier"&gt;sealed&amp;nbsp; (ADESK_SEALED)&lt;/FONT&gt;, which means that they can not be overridden. DBX modules must instead override the &lt;FONT face="courier new,courier"&gt;sub*()&lt;/FONT&gt; methods (like &lt;FONT face="courier new,courier"&gt;subIntersectWith()&lt;/FONT&gt;) in custom entity classes.&lt;/P&gt;
&lt;P&gt;On the other hand your ARX application still must &lt;U&gt;call&lt;/U&gt; &lt;FONT face="courier new,courier"&gt;pEnt-&amp;gt;intersectWith() -&lt;/FONT&gt; &lt;U&gt;not&amp;nbsp;&lt;/U&gt; &lt;FONT face="courier new,courier"&gt;pEnt-&amp;gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;subIntersectWith()&lt;/FONT&gt;!&lt;/P&gt;
&lt;P&gt;I still have the ARX2010 SDK on my machine and searched for sdk_map_names.h. I don't have this header. Have you created it yourself?&lt;/P&gt;
&lt;P&gt;Make sure that you use it's #defines in your DBX / custom entity code only - not in your ARX command implementation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 07:36:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6980549#M8475</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2017-03-29T07:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981431#M8476</link>
      <description>&lt;P&gt;I updated my AutoCAD, but nothing changed.&lt;/P&gt;&lt;P&gt;&lt;div class="video-embed-center video-embed"&gt;&lt;iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fw-ixDI0vqhc%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dw-ixDI0vqhc&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fw-ixDI0vqhc%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" width="200" height="113" scrolling="no" title="Bug of intersectWith" frameborder="0" allow="autoplay; fullscreen; encrypted-media; picture-in-picture;" allowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;The same code works for bricsCAD. I don't quite understand&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 14:18:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981431#M8476</guid>
      <dc:creator>syx_lemans</dc:creator>
      <dc:date>2017-03-29T14:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981465#M8477</link>
      <description>&lt;P&gt;I don't develop a lot for CAD. So I just pick the sample code and change something.&lt;/P&gt;&lt;P&gt;This may cause my problem.&lt;/P&gt;&lt;P&gt;When I comment the line of "subIntersectwith"&lt;/P&gt;&lt;P&gt;My program can be successfully compiled. But it got a fatal error when I use it for two intersecting entities. I didn't override this function.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 14:26:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981465#M8477</guid>
      <dc:creator>syx_lemans</dc:creator>
      <dc:date>2017-03-29T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981686#M8478</link>
      <description>&lt;P&gt;1. Install ObjectARX Wizard 2011&lt;/P&gt;
&lt;P&gt;2. Create new project with help of ObjectARX Wizard&lt;/P&gt;
&lt;P&gt;3. Change content of acrxEntryPoint.cpp with my code&lt;/P&gt;
&lt;P&gt;4. Compile and link this project with Visual Studio 2008 SP1&lt;/P&gt;
&lt;P&gt;5. Check again&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 15:30:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981686#M8478</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-03-29T15:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981716#M8479</link>
      <description>&lt;P&gt;I've checked code with AutoCAD 2012, VS 2008 SP1 and ObjectARX SDK 2010. No errors: &lt;A href="http://autode.sk/2nh5iqG" target="_blank"&gt;http://autode.sk/2nh5iqG&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 15:40:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6981716#M8479</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-03-29T15:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6986583#M8480</link>
      <description>&lt;P&gt;It's a problem with my AutoCAD. It works with other version.&lt;/P&gt;&lt;P&gt;There is no problem with the code.&lt;/P&gt;&lt;P&gt;Thank you so much for your replies&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 07:46:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/6986583#M8480</guid>
      <dc:creator>syx_lemans</dc:creator>
      <dc:date>2017-03-31T07:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/7063700#M8481</link>
      <description>&lt;P&gt;I didn't succeed to install objectarx wizard for vs2008 sp1. I got an issue " there is a problem with this windows installer package ".&lt;/P&gt;&lt;P&gt;Could I send my code to you to compile it and send me the arx file?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 08:52:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/7063700#M8481</guid>
      <dc:creator>syx_lemans</dc:creator>
      <dc:date>2017-05-05T08:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: bug of intersectWith()</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/7063851#M8482</link>
      <description>&lt;P&gt;Sorry it's solved.&lt;/P&gt;&lt;P&gt;It's a User Account Control problem&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 10:07:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bug-of-intersectwith/m-p/7063851#M8482</guid>
      <dc:creator>syx_lemans</dc:creator>
      <dc:date>2017-05-05T10:07:10Z</dc:date>
    </item>
  </channel>
</rss>

