<?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: Talking about Explode - is this a bug? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470658#M17726</link>
    <description>Those points are just for testing purposes, and to show where the crossing &lt;BR /&gt;
selection it is made. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Luis.&lt;BR /&gt;
&lt;BR /&gt;
"alexb" &lt;ALEXB&gt; wrote in message &lt;BR /&gt;
news:6165245@discussion.autodesk.com...&lt;BR /&gt;
Your ExplodeCode command creates a series of point entities.&lt;BR /&gt;
Is this by design?&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165206@discussion.autodesk.com...&lt;BR /&gt;
Hi Owen,&lt;BR /&gt;
&lt;BR /&gt;
For some reason, I cannot make a selection on the recently exploded (via&lt;BR /&gt;
code) entities.&lt;BR /&gt;
&lt;BR /&gt;
I'm including a small visual studio project (A2007) and the arx file, with&lt;BR /&gt;
two commands: ExplodeCode and ExplodeCmd.&lt;BR /&gt;
Just use the command rectangle and test both commands.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*&lt;BR /&gt;
&lt;BR /&gt;
"Owen Wengerd" &lt;OWENW&gt;&lt;BR /&gt;
Luis:&lt;BR /&gt;
&lt;BR /&gt;
  What exactly do you mean by "does not work as I was expecting"?  Did you&lt;BR /&gt;
perhaps forget to call transformBy() on the exploded entities?&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft &lt;&gt;&lt;BR /&gt;
VP Americas, CADLock, Inc. &lt;&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165037@discussion.autodesk.com...&lt;BR /&gt;
or it is my code....&lt;BR /&gt;
&lt;BR /&gt;
I use the code below to explode a custom object but the explode(); method&lt;BR /&gt;
does not work as I was expecting, even if I ran the test on a closed&lt;BR /&gt;
polyline (formed of lines) the selection I made on each of the segments&lt;BR /&gt;
simple does not work, but if I use the AutoCAD built-in command EXPLODE,&lt;BR /&gt;
then all work as expected.&lt;BR /&gt;
&lt;BR /&gt;
If someone can check and run the code, will see what I'm talking about.&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;/LE&gt;&lt;/&gt;&lt;/&gt;&lt;/OWENW&gt;&lt;/LE&gt;&lt;/ALEXB&gt;</description>
    <pubDate>Sat, 18 Apr 2009 15:46:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-04-18T15:46:30Z</dc:date>
    <item>
      <title>Talking about Explode - is this a bug?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470654#M17722</link>
      <description>or it is my code....&lt;BR /&gt;
&lt;BR /&gt;
I use the code below to explode a custom object but the explode(); method &lt;BR /&gt;
does not work as I was expecting, even if I ran the test on a closed &lt;BR /&gt;
polyline (formed of lines) the selection I made on each of the segments &lt;BR /&gt;
simple does not work, but if I use the AutoCAD built-in command EXPLODE, &lt;BR /&gt;
then all work as expected.&lt;BR /&gt;
&lt;BR /&gt;
If someone can check and run the code, will see what I'm talking about.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Luis.&lt;BR /&gt;
&lt;BR /&gt;
// code start here&lt;BR /&gt;
const double kPi = 3.14159265358979323846;&lt;BR /&gt;
void segmentDivision (AcGePoint3d p1, AcGePoint3d p2, double ndiv, &lt;BR /&gt;
AcGePoint3d &amp;amp;ptres)&lt;BR /&gt;
{&lt;BR /&gt;
 ptres.x = p1.x + (p2.x - p1.x) / ndiv;&lt;BR /&gt;
 ptres.y = p1.y + (p2.y - p1.y) / ndiv;&lt;BR /&gt;
 ptres.z = p1.z + (p2.z - p1.z) / ndiv;&lt;BR /&gt;
}&lt;BR /&gt;
bool postToDatabase (AcDbObjectId blkName, AcDbEntity *pEntity, AcDbObjectId &lt;BR /&gt;
&amp;amp;pOutputId)&lt;BR /&gt;
{&lt;BR /&gt;
 AcDbBlockTableRecordPointer pBlk(blkName, AcDb::kForWrite);&lt;BR /&gt;
 if (pBlk.openStatus() != Acad::eOk) return (false);&lt;BR /&gt;
 return (pBlk-&amp;gt;appendAcDbEntity(pOutputId, pEntity) == Acad::eOk);&lt;BR /&gt;
}&lt;BR /&gt;
bool ExplodeEntity (AcDbObjectId entId, AcDbObjectIdArray &amp;amp;ids)&lt;BR /&gt;
{&lt;BR /&gt;
 ids.removeAll();&lt;BR /&gt;
 AcDbVoidPtrArray entitySet;&lt;BR /&gt;
 AcDbObjectId pOutputId;&lt;BR /&gt;
 AcDbObjectPointer&lt;ACDBENTITY&gt; pEnt(entId, AcDb::kForWrite);&lt;BR /&gt;
 if (pEnt.openStatus() != Acad::eOk) return false;&lt;BR /&gt;
 if (pEnt-&amp;gt;explode(entitySet) == Acad::eOk)&lt;BR /&gt;
 {&lt;BR /&gt;
  pEnt-&amp;gt;erase();&lt;BR /&gt;
  for (int i = 0; i &amp;lt; entitySet.length(); i++)&lt;BR /&gt;
  {&lt;BR /&gt;
   AcDbEntity *pNewEnt = AcDbEntity::cast((AcRxObject*)entitySet&lt;I&gt;);&lt;BR /&gt;
   if (pNewEnt &amp;amp;&amp;amp; postToDatabase(acdbCurDwg()-&amp;gt;currentSpaceId(), pNewEnt, &lt;BR /&gt;
pOutputId))&lt;BR /&gt;
   {&lt;BR /&gt;
    pNewEnt-&amp;gt;setColorIndex(1);&lt;BR /&gt;
    pNewEnt-&amp;gt;close();&lt;BR /&gt;
    ids.append(pOutputId);&lt;BR /&gt;
   }&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;BR /&gt;
 if (ids.isEmpty()) return false;&lt;BR /&gt;
 else return true;&lt;BR /&gt;
}&lt;BR /&gt;
void MyExplode (void)&lt;BR /&gt;
{&lt;BR /&gt;
 AcDbObjectId entId;&lt;BR /&gt;
 ads_name entres;&lt;BR /&gt;
 ads_point ptres;&lt;BR /&gt;
 if (acedEntSel(_T("\nSelect polyline to explode: "), entres, ptres) != &lt;BR /&gt;
RTNORM) return;&lt;BR /&gt;
 if (acdbGetObjectId(entId, entres) != Acad::eOk) return;&lt;BR /&gt;
 AcDbObjectIdArray sset;&lt;BR /&gt;
 ExplodeEntity(entId, sset); // does not work&lt;BR /&gt;
 // if the line above it is removed and these lines are used the code works&lt;BR /&gt;
 //struct resbuf *cmdlist = NULL;&lt;BR /&gt;
 //cmdlist = acutBuildList(RTSTR, _T("_.EXPLODE"), RTENAME, entres, 0); // &lt;BR /&gt;
this one works&lt;BR /&gt;
 //acedCmd(cmdlist);&lt;BR /&gt;
 //acutRelRb(cmdlist);&lt;BR /&gt;
 //acedGetCurrentSelectionSet(sset);&lt;BR /&gt;
&lt;BR /&gt;
AcDbDatabase* pDb = acdbHostApplicationServices()-&amp;gt;workingDatabase(); // &lt;BR /&gt;
test&lt;BR /&gt;
AcDbBlockTableRecordPointer pBTR(pDb-&amp;gt;currentSpaceId(), AcDb::kForWrite); // &lt;BR /&gt;
test&lt;BR /&gt;
AcDbPoint *pPoint = NULL;&lt;BR /&gt;
 for (UINT i = 0; i &amp;lt; sset.length(); i++)&lt;BR /&gt;
 {&lt;BR /&gt;
  AcDbObjectPointer&lt;ACDBLINE&gt; pEnt(sset&lt;I&gt;, AcDb::kForRead);&lt;BR /&gt;
  if (pEnt.openStatus() == Acad::eOk)&lt;BR /&gt;
  {&lt;BR /&gt;
   AcGePoint3d p0, p1, m;&lt;BR /&gt;
   pEnt-&amp;gt;getStartPoint(p0);&lt;BR /&gt;
   pEnt-&amp;gt;getEndPoint(p1);&lt;BR /&gt;
   segmentDivision(p0, p1, 2.0, m);&lt;BR /&gt;
   double d = (sqrt(2.0) * (p0.distanceTo(p1) / 2.0));&lt;BR /&gt;
   ads_point ptres, a, b, p01, p11, p02, p12;&lt;BR /&gt;
   // extract two diagonal points a-b for crossing selection&lt;BR /&gt;
   acutPolar(asDblArray(m), ((3 * kPi) / 4), d, ptres);&lt;BR /&gt;
   acdbWcs2Ucs(ptres, a, false);&lt;BR /&gt;
   acutPolar(asDblArray(m), ((7 * kPi) / 4), d, ptres);&lt;BR /&gt;
   acdbWcs2Ucs(ptres, b, false);&lt;BR /&gt;
// draw the points - test&lt;BR /&gt;
pPoint = new AcDbPoint(asPnt3d(a));&lt;BR /&gt;
if (pPoint &amp;amp;&amp;amp; Acad::eOk == pBTR.openStatus())&lt;BR /&gt;
{&lt;BR /&gt;
 pBTR-&amp;gt;appendAcDbEntity(pPoint);&lt;BR /&gt;
 pPoint-&amp;gt;close();&lt;BR /&gt;
}&lt;BR /&gt;
pPoint = new AcDbPoint(asPnt3d(b));&lt;BR /&gt;
if (pPoint &amp;amp;&amp;amp; Acad::eOk == pBTR.openStatus())&lt;BR /&gt;
{&lt;BR /&gt;
 pBTR-&amp;gt;appendAcDbEntity(pPoint);&lt;BR /&gt;
 pPoint-&amp;gt;close();&lt;BR /&gt;
}&lt;BR /&gt;
   ads_name ss;&lt;BR /&gt;
   resbuf *rbFilter = acutBuildList(RTDXF0, _T("LINE"), RTNONE);&lt;BR /&gt;
   if (acedSSGet(_T("_C"), a, b, rbFilter, ss) != RTNORM)&lt;BR /&gt;
   {&lt;BR /&gt;
    acutRelRb(rbFilter);&lt;BR /&gt;
    acutPrintf(_T("\nInvalid crossing selection. ")); // debug&lt;BR /&gt;
    return;&lt;BR /&gt;
   }&lt;BR /&gt;
   acutRelRb(rbFilter);&lt;BR /&gt;
   long len = 0;&lt;BR /&gt;
   if ((acedSSLength(ss, &amp;amp;len) != RTNORM) || (len == 0))&lt;BR /&gt;
   {&lt;BR /&gt;
    acedSSFree(ss);&lt;BR /&gt;
    return;&lt;BR /&gt;
   }&lt;BR /&gt;
   acutPrintf(_T("\nNumber of entities selected[%ld]"), len);&lt;BR /&gt;
   acedSSFree(ss);&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;BR /&gt;
}&lt;BR /&gt;
// code end here&lt;/I&gt;&lt;/ACDBLINE&gt;&lt;/I&gt;&lt;/ACDBENTITY&gt;</description>
      <pubDate>Fri, 17 Apr 2009 19:54:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470654#M17722</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-17T19:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Talking about Explode - is this a bug?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470655#M17723</link>
      <description>Luis:&lt;BR /&gt;
&lt;BR /&gt;
  What exactly do you mean by "does not work as I was expecting"?  Did you &lt;BR /&gt;
perhaps forget to call transformBy() on the exploded entities?&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft &lt;&gt;&lt;BR /&gt;
VP Americas, CADLock, Inc. &lt;&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165037@discussion.autodesk.com...&lt;BR /&gt;
or it is my code....&lt;BR /&gt;
&lt;BR /&gt;
I use the code below to explode a custom object but the explode(); method&lt;BR /&gt;
does not work as I was expecting, even if I ran the test on a closed&lt;BR /&gt;
polyline (formed of lines) the selection I made on each of the segments&lt;BR /&gt;
simple does not work, but if I use the AutoCAD built-in command EXPLODE,&lt;BR /&gt;
then all work as expected.&lt;BR /&gt;
&lt;BR /&gt;
If someone can check and run the code, will see what I'm talking about.&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;/LE&gt;&lt;/&gt;&lt;/&gt;</description>
      <pubDate>Fri, 17 Apr 2009 20:54:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470655#M17723</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-17T20:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Talking about Explode - is this a bug?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470656#M17724</link>
      <description>Hi Owen,&lt;BR /&gt;
&lt;BR /&gt;
For some reason, I cannot make a selection on the recently exploded (via &lt;BR /&gt;
code) entities.&lt;BR /&gt;
&lt;BR /&gt;
I'm including a small visual studio project (A2007) and the arx file, with &lt;BR /&gt;
two commands: ExplodeCode and ExplodeCmd.&lt;BR /&gt;
Just use the command rectangle and test both commands.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*&lt;BR /&gt;
&lt;BR /&gt;
"Owen Wengerd" &lt;OWENW&gt;&lt;BR /&gt;
Luis:&lt;BR /&gt;
&lt;BR /&gt;
  What exactly do you mean by "does not work as I was expecting"?  Did you&lt;BR /&gt;
perhaps forget to call transformBy() on the exploded entities?&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft &lt;&gt;&lt;BR /&gt;
VP Americas, CADLock, Inc. &lt;&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165037@discussion.autodesk.com...&lt;BR /&gt;
or it is my code....&lt;BR /&gt;
&lt;BR /&gt;
I use the code below to explode a custom object but the explode(); method&lt;BR /&gt;
does not work as I was expecting, even if I ran the test on a closed&lt;BR /&gt;
polyline (formed of lines) the selection I made on each of the segments&lt;BR /&gt;
simple does not work, but if I use the AutoCAD built-in command EXPLODE,&lt;BR /&gt;
then all work as expected.&lt;BR /&gt;
&lt;BR /&gt;
If someone can check and run the code, will see what I'm talking about.&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;/LE&gt;&lt;/&gt;&lt;/&gt;&lt;/OWENW&gt;</description>
      <pubDate>Fri, 17 Apr 2009 23:52:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470656#M17724</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-17T23:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Talking about Explode - is this a bug?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470657#M17725</link>
      <description>Your ExplodeCode command creates a series of point entities.&lt;BR /&gt;
Is this by design?&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165206@discussion.autodesk.com...&lt;BR /&gt;
Hi Owen,&lt;BR /&gt;
&lt;BR /&gt;
For some reason, I cannot make a selection on the recently exploded (via&lt;BR /&gt;
code) entities.&lt;BR /&gt;
&lt;BR /&gt;
I'm including a small visual studio project (A2007) and the arx file, with&lt;BR /&gt;
two commands: ExplodeCode and ExplodeCmd.&lt;BR /&gt;
Just use the command rectangle and test both commands.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*&lt;BR /&gt;
&lt;BR /&gt;
"Owen Wengerd" &lt;OWENW&gt;&lt;BR /&gt;
Luis:&lt;BR /&gt;
&lt;BR /&gt;
  What exactly do you mean by "does not work as I was expecting"?  Did you&lt;BR /&gt;
perhaps forget to call transformBy() on the exploded entities?&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft &lt;&gt;&lt;BR /&gt;
VP Americas, CADLock, Inc. &lt;&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165037@discussion.autodesk.com...&lt;BR /&gt;
or it is my code....&lt;BR /&gt;
&lt;BR /&gt;
I use the code below to explode a custom object but the explode(); method&lt;BR /&gt;
does not work as I was expecting, even if I ran the test on a closed&lt;BR /&gt;
polyline (formed of lines) the selection I made on each of the segments&lt;BR /&gt;
simple does not work, but if I use the AutoCAD built-in command EXPLODE,&lt;BR /&gt;
then all work as expected.&lt;BR /&gt;
&lt;BR /&gt;
If someone can check and run the code, will see what I'm talking about.&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;/LE&gt;&lt;/&gt;&lt;/&gt;&lt;/OWENW&gt;&lt;/LE&gt;</description>
      <pubDate>Sat, 18 Apr 2009 10:40:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470657#M17725</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-18T10:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Talking about Explode - is this a bug?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470658#M17726</link>
      <description>Those points are just for testing purposes, and to show where the crossing &lt;BR /&gt;
selection it is made. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Luis.&lt;BR /&gt;
&lt;BR /&gt;
"alexb" &lt;ALEXB&gt; wrote in message &lt;BR /&gt;
news:6165245@discussion.autodesk.com...&lt;BR /&gt;
Your ExplodeCode command creates a series of point entities.&lt;BR /&gt;
Is this by design?&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165206@discussion.autodesk.com...&lt;BR /&gt;
Hi Owen,&lt;BR /&gt;
&lt;BR /&gt;
For some reason, I cannot make a selection on the recently exploded (via&lt;BR /&gt;
code) entities.&lt;BR /&gt;
&lt;BR /&gt;
I'm including a small visual studio project (A2007) and the arx file, with&lt;BR /&gt;
two commands: ExplodeCode and ExplodeCmd.&lt;BR /&gt;
Just use the command rectangle and test both commands.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/*&lt;BR /&gt;
&lt;BR /&gt;
"Owen Wengerd" &lt;OWENW&gt;&lt;BR /&gt;
Luis:&lt;BR /&gt;
&lt;BR /&gt;
  What exactly do you mean by "does not work as I was expecting"?  Did you&lt;BR /&gt;
perhaps forget to call transformBy() on the exploded entities?&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft &lt;&gt;&lt;BR /&gt;
VP Americas, CADLock, Inc. &lt;&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;LE&gt; wrote in message news:6165037@discussion.autodesk.com...&lt;BR /&gt;
or it is my code....&lt;BR /&gt;
&lt;BR /&gt;
I use the code below to explode a custom object but the explode(); method&lt;BR /&gt;
does not work as I was expecting, even if I ran the test on a closed&lt;BR /&gt;
polyline (formed of lines) the selection I made on each of the segments&lt;BR /&gt;
simple does not work, but if I use the AutoCAD built-in command EXPLODE,&lt;BR /&gt;
then all work as expected.&lt;BR /&gt;
&lt;BR /&gt;
If someone can check and run the code, will see what I'm talking about.&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;/LE&gt;&lt;/&gt;&lt;/&gt;&lt;/OWENW&gt;&lt;/LE&gt;&lt;/ALEXB&gt;</description>
      <pubDate>Sat, 18 Apr 2009 15:46:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/talking-about-explode-is-this-a-bug/m-p/2470658#M17726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-18T15:46:30Z</dc:date>
    </item>
  </channel>
</rss>

