<?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: Problem using intersectWith in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3255950#M15266</link>
    <description>&lt;P&gt;Is this line neccessary "geBraceLine.getPerpLine(supportPt2d, gePerpLine)"? Could it leave the line outside the circle?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try some version of the following it may be easier to debug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcDbLine geBraceLine(AcGePoint3d(-2,0,0), AcGePoint3d(2,0,0));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcGeMatrix3d xform1;&lt;/P&gt;&lt;P&gt;xform1.setToRotation(UtilsGe::kRad90, AcGeVector3d::kZAxis, AcGePoint3d(0,0,0));&lt;/P&gt;&lt;P&gt;geBraceLine.transformBy(xform1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcGePoint3d startPt = geBraceLine.startPoint();&lt;/P&gt;&lt;P&gt;AcGePoint3d endPt = geBraceLine.endPoint();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcDbLine gePerpLine(startPt, endPt);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// get a construction circle over brace circle&lt;/P&gt;&lt;P&gt;// find intersections with construction circle and line&lt;/P&gt;&lt;P&gt;AcDbCircle geBraceCircle(AcGePoint3d(0,0,0),AcGeVector3d::kZAxis, 1);&lt;/P&gt;&lt;P&gt;AcGePoint3dArray points;&lt;/P&gt;&lt;P&gt;geBraceCircle.intersectWith(&amp;amp;gePerpLine, AcDb::kOnBothOperands, points);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for(int i=0; i&amp;lt;points.length(); i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CString str;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptToStr(points[i], str);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acutPrintf(L"\n %s", str);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shane.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2011 19:57:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-12-08T19:57:33Z</dc:date>
    <item>
      <title>Problem using intersectWith</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3254120#M15264</link>
      <description>&lt;P&gt;I am having a problem using the intersectWith function to return an intersection between a circle and line, both of which are AcGe class objects. Can someone please point me in the right direction? The relevant code is&amp;nbsp;below. Also, any pointers on anything else that is done incorrectly would be appreciated. I am trying to basically draw a circle, then draw a leader from the center to a chosen point, then finally draw two lines starting at the leader tip back to the circle,&amp;nbsp;90 degrees around to each side from where the leader intersects it. The problem is that it does not find any intersection points and draws instead to the origin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;Ralph&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;		// Create the circle
		double const Pi = 3.14159265358979;
		AcGePoint3d centerPt;				// center point of brace circle
		AcDbCircle* pBraceCircle;			// pointer to brace circle
		if(acedGetPoint(NULL, _T("\nSpecify brace point on roof: "), asDblArray(centerPt)))
		{
			float radius(4.5);				// circle radius
			pBraceCircle = new AcDbCircle(centerPt, AcGeVector3d::kZAxis, radius);
			// Add the circle to database and close it
			addToModelSpace(pBraceCircle);
			pBraceCircle-&amp;gt;close();
		}

		// Create the leader
		AcGePoint3d supportPt;				// point on wall or beam
		if(acedGetPoint(asDblArray(centerPt), _T("\nSpecify support point for brace: "), asDblArray(supportPt)))
		{
			AcDbLeader* pLeader = new AcDbLeader();
			// add the leader to database and then close it
			addToModelSpace(pLeader);
			pLeader-&amp;gt;appendVertex(supportPt);
			pLeader-&amp;gt;appendVertex(centerPt);
			pLeader-&amp;gt;close();
		}

		// Create the lines connecting the leader tip to the circle sides
		// convert the 3d points at brace and support points to 2d
		AcGePoint2d supportPt2d(supportPt.x, supportPt.y);
		AcGePoint2d centerPt2d(centerPt.x, centerPt.y);
		
		// get a construction line in direction of leader and rotate 90 degrees
		AcGeLineSeg2d geBraceLine(supportPt2d, centerPt2d);
		AcGeLine2d gePerpLine;
		geBraceLine.getPerpLine(supportPt2d, gePerpLine);
		gePerpLine.rotateBy(Pi/2, centerPt2d);
		

		// get a construction circle over brace circle
		// find intersections with construction circle and line
		AcGeCircArc2d geBraceCircle(centerPt2d, 4.5);
		int intN;									// number of intersections
		AcGePoint2d intersPt1, intersPt2;			// intersecting points
		geBraceCircle.intersectWith(gePerpLine, intN, intersPt1, intersPt2);
		
		// create the first line, add to database and close
		AcGePoint3d StartPt1( intersPt1.x, intersPt1.y, 0);
		AcDbLine* pBraceLine1 = new AcDbLine(StartPt1, supportPt);
		addToModelSpace(pBraceLine1);
		pBraceLine1-&amp;gt;close();
		
		// create the second line, add to database and close
		AcGePoint3d StartPt2( intersPt2.x, intersPt2.y, 0);
		AcDbLine* pBraceLine2 = new AcDbLine(StartPt2, supportPt);
		addToModelSpace(pBraceLine2);
		pBraceLine2-&amp;gt;close();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2011 19:17:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3254120#M15264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-07T19:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using intersectWith</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3255080#M15265</link>
      <description>&lt;P&gt;Sorry I didn't read your code but just a thought: ensure the line and the circle has the same extrusion direction. You can set the UCS to line ECS before drawing the circle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3wood&lt;/P&gt;&lt;P&gt;&lt;A target="_self" href="http://http://sites.google.com/site/cadkits/home"&gt;CAD KITS&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2011 12:25:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3255080#M15265</guid>
      <dc:creator>3wood</dc:creator>
      <dc:date>2011-12-08T12:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using intersectWith</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3255950#M15266</link>
      <description>&lt;P&gt;Is this line neccessary "geBraceLine.getPerpLine(supportPt2d, gePerpLine)"? Could it leave the line outside the circle?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try some version of the following it may be easier to debug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcDbLine geBraceLine(AcGePoint3d(-2,0,0), AcGePoint3d(2,0,0));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcGeMatrix3d xform1;&lt;/P&gt;&lt;P&gt;xform1.setToRotation(UtilsGe::kRad90, AcGeVector3d::kZAxis, AcGePoint3d(0,0,0));&lt;/P&gt;&lt;P&gt;geBraceLine.transformBy(xform1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcGePoint3d startPt = geBraceLine.startPoint();&lt;/P&gt;&lt;P&gt;AcGePoint3d endPt = geBraceLine.endPoint();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AcDbLine gePerpLine(startPt, endPt);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// get a construction circle over brace circle&lt;/P&gt;&lt;P&gt;// find intersections with construction circle and line&lt;/P&gt;&lt;P&gt;AcDbCircle geBraceCircle(AcGePoint3d(0,0,0),AcGeVector3d::kZAxis, 1);&lt;/P&gt;&lt;P&gt;AcGePoint3dArray points;&lt;/P&gt;&lt;P&gt;geBraceCircle.intersectWith(&amp;amp;gePerpLine, AcDb::kOnBothOperands, points);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for(int i=0; i&amp;lt;points.length(); i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CString str;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptToStr(points[i], str);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; acutPrintf(L"\n %s", str);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shane.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2011 19:57:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3255950#M15266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-08T19:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using intersectWith</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3257760#M15267</link>
      <description>&lt;P&gt;Thank you both for the replies. Shane, I used the AcDb lines instead of the AcGe ones and that seemed to correct the issue. I guess I'll have to play around with the AcGe objects for a while before I understand them. I can't seem to get anything useful out of the debugger - just hexadecimal information. I am interested in the ptToStr function you called, though. I don't seem to have that one. Is that something "new"? (I'm still on AutoCAD 2008 until I get all of my old VBA code updated.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Ralph&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2011 21:04:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3257760#M15267</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-09T21:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using intersectWith</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3257952#M15268</link>
      <description>&lt;P&gt;Ralph,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a look at the ARXDBG project in samples/database. You will find ptToStr in ArxDbgUtils.h along with a great deal other useful functions. If you import ArxDbgUtils into your project it will simplify many common tasks. Also I find the ArxDbgUiPr... classes very useful for simplifying user interaction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2011 00:40:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/3257952#M15268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-10T00:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using intersectWith</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/4303885#M15269</link>
      <description>&lt;P&gt;I use objectarx2012, cad 2012.&amp;nbsp; i've tesed intersectWith function. Here's code :&lt;BR /&gt;static void Test(void){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcDbObjectId oId;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcArray&amp;lt;AcGePoint3d&amp;gt; IntersectionPoints;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ads_name name1, name2;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AcDbEntity *pEnt1,*pEnt2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ////&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;////////////////////&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; acedEntSel(L"\nSelect Ent1(line1 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ",name1,pt);&amp;nbsp;&amp;nbsp;&amp;nbsp; acdbGetObjectId(oId, name1);&amp;nbsp;&amp;nbsp;&amp;nbsp; acdbOpenAcDbEntity(pEnt1,oId,AcDb::kForRead);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; acedEntSel(L"\nSelect Ent2(line1 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ",name2,pt);&amp;nbsp;&amp;nbsp;&amp;nbsp; acdbGetObjectId(oId, name2);&amp;nbsp;&amp;nbsp;&amp;nbsp; acdbOpenAcDbEntity(pEnt2,oId,AcDb::kForRead);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnt1-&amp;gt;intersectWith(pEnt2,AcDb::kOnBothOperands ,AcGePlane::kXYPlane, IntersectionPoints,&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,0 );&amp;nbsp;&amp;nbsp;&amp;nbsp; //May be this line cause error!&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnt1-&amp;gt;close(); pEnt2-&amp;gt;close();&lt;BR /&gt;// //&amp;nbsp; Autocad crashed when go out this&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Autocad crashed when Test ended.&lt;BR /&gt;Can AnyOne help me?&lt;BR /&gt;Thank advance.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2013 04:55:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/4303885#M15269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-20T04:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using intersectWith</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/4303914#M15270</link>
      <description>&lt;P&gt;Please start a new thread, and include more information. "AutoCAD crashed" is not enough detail.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2013 05:55:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/problem-using-intersectwith/m-p/4303914#M15270</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2013-06-20T05:55:21Z</dc:date>
    </item>
  </channel>
</rss>

