<?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: in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311844#M39590</link>
    <description>Thank you David, boy do I feel dumb. That seems to have fixed it.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
&lt;BR /&gt;
David Bartliff wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Bill,&lt;BR /&gt;
&amp;gt; I don't think you are allocating the correct memory.&lt;BR /&gt;
&amp;gt; Unless I'm having a brainstorm Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
&amp;gt; will return the number of vertices and the size of the array to allocate.&lt;BR /&gt;
&amp;gt; i.e. AcGePoint3d *verts = new AcGePoint3d[numVerts];&lt;BR /&gt;
&amp;gt; If you have 6 vertices, then you need to allocate enough memory for 6. 5 is&lt;BR /&gt;
&amp;gt; the upper limit on the index, not the size to allocate.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Bill Wright" &lt;W.WRIGHT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:3D6E388A.27C06316@archsky.com...&lt;BR /&gt;
&amp;gt; &amp;gt; This is another shot at my last post about pointer problems. This time I&lt;BR /&gt;
&amp;gt; &amp;gt; am including the function that is passing the pointer because I think&lt;BR /&gt;
&amp;gt; &amp;gt; this is where the real problem is originating. What I'm trying to do is&lt;BR /&gt;
&amp;gt; &amp;gt; pass an array of points to my object then that object will ultimately&lt;BR /&gt;
&amp;gt; &amp;gt; use those points to set up more points in the object. I can run the&lt;BR /&gt;
&amp;gt; &amp;gt; insert function several times without trouble then I will crash.&lt;BR /&gt;
&amp;gt; &amp;gt; Sometimes if I unload my program and reload it it will crash after only&lt;BR /&gt;
&amp;gt; &amp;gt; running it a few times. Obviously I'm new at this so any help would be&lt;BR /&gt;
&amp;gt; &amp;gt; appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; this is my arx command function:&lt;BR /&gt;
&amp;gt; &amp;gt; void InsertMyObject()&lt;BR /&gt;
&amp;gt; &amp;gt; {&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbDatabase *pCurDb;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbObjectId LinId;&lt;BR /&gt;
&amp;gt; &amp;gt;  Acad::ErrorStatus es;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  //get the current database&lt;BR /&gt;
&amp;gt; &amp;gt;  pCurDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbObjectId SectionPolyId;&lt;BR /&gt;
&amp;gt; &amp;gt;  int GsMark;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbPolyline *pPline;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcGePoint3d Vertex;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  //get the object ID of the polyline&lt;BR /&gt;
&amp;gt; &amp;gt;  es = getObjectAndGsMarker(SectionPolyId, GsMark);&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  //open the pline for reading&lt;BR /&gt;
&amp;gt; &amp;gt;  acdbOpenObject(pPline, SectionPolyId, AcDb::kForRead);&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     // Set up the vertices.&lt;BR /&gt;
&amp;gt; &amp;gt;     Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
&amp;gt; &amp;gt;     AcGePoint3d *verts = new AcGePoint3d[(numVerts - 1)];&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts; vertexNumber++)&lt;BR /&gt;
&amp;gt; &amp;gt;   {&lt;BR /&gt;
&amp;gt; &amp;gt;    es = pPline-&amp;gt;getPointAt(vertexNumber, Vertex);&lt;BR /&gt;
&amp;gt; &amp;gt;    verts[vertexNumber] = Vertex;&lt;BR /&gt;
&amp;gt; &amp;gt;   }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     pPline-&amp;gt;close();  // Finished with the pline header.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  MyDBXObject *pObj;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  pObj = new LPLineal;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  pObj-&amp;gt;SetCrossSection(verts, numVerts);&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  es = appendToBlockTable(pObj, LinId, ACDB_MODEL_SPACE, pCurDb);&lt;BR /&gt;
&amp;gt; &amp;gt;  if(es != Acad::eOk)&lt;BR /&gt;
&amp;gt; &amp;gt;  {&lt;BR /&gt;
&amp;gt; &amp;gt;   acutPrintf("\nError drawing My object!");&lt;BR /&gt;
&amp;gt; &amp;gt;   if(pObj)&lt;BR /&gt;
&amp;gt; &amp;gt;   {&lt;BR /&gt;
&amp;gt; &amp;gt;    delete pObj;&lt;BR /&gt;
&amp;gt; &amp;gt;    return;&lt;BR /&gt;
&amp;gt; &amp;gt;   }&lt;BR /&gt;
&amp;gt; &amp;gt;  }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  pObj-&amp;gt;close();&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; this is my dbx object that seems to cause problems:&lt;BR /&gt;
&amp;gt; &amp;gt; void MyDBXObject::SetCrossSection(AcGePoint3d*&amp;amp; verts, Adesk::UInt32&lt;BR /&gt;
&amp;gt; &amp;gt; numVerts)&lt;BR /&gt;
&amp;gt; &amp;gt; {&lt;BR /&gt;
&amp;gt; &amp;gt;  AcGePoint3d location;&lt;BR /&gt;
&amp;gt; &amp;gt;  m_numStartSectionVerts = numVerts;&lt;BR /&gt;
&amp;gt; &amp;gt;  m_StartSectionVerts = verts;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts ; vertexNumber++)&lt;BR /&gt;
&amp;gt; &amp;gt; {&lt;BR /&gt;
&amp;gt; &amp;gt;   location = m_StartSectionVerts[vertexNumber];&lt;BR /&gt;
&amp;gt; &amp;gt;   location.z = 10.00;&lt;BR /&gt;
&amp;gt; &amp;gt;  }&lt;BR /&gt;
&amp;gt; &amp;gt; }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;/W.WRIGHT&gt;</description>
    <pubDate>Thu, 29 Aug 2002 10:05:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-08-29T10:05:24Z</dc:date>
    <item>
      <title>Fatal error</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311842#M39588</link>
      <description>This is another shot at my last post about pointer problems. This time I&lt;BR /&gt;
am including the function that is passing the pointer because I think&lt;BR /&gt;
this is where the real problem is originating. What I'm trying to do is&lt;BR /&gt;
pass an array of points to my object then that object will ultimately&lt;BR /&gt;
use those points to set up more points in the object. I can run the&lt;BR /&gt;
insert function several times without trouble then I will crash.&lt;BR /&gt;
Sometimes if I unload my program and reload it it will crash after only&lt;BR /&gt;
running it a few times. Obviously I'm new at this so any help would be&lt;BR /&gt;
appreciated.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
this is my arx command function:&lt;BR /&gt;
void InsertMyObject()&lt;BR /&gt;
{&lt;BR /&gt;
 AcDbDatabase *pCurDb;&lt;BR /&gt;
 AcDbObjectId LinId;&lt;BR /&gt;
 Acad::ErrorStatus es;&lt;BR /&gt;
&lt;BR /&gt;
 //get the current database&lt;BR /&gt;
 pCurDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();&lt;BR /&gt;
&lt;BR /&gt;
 AcDbObjectId SectionPolyId;&lt;BR /&gt;
 int GsMark;&lt;BR /&gt;
 AcDbPolyline *pPline;&lt;BR /&gt;
 AcGePoint3d Vertex;&lt;BR /&gt;
&lt;BR /&gt;
 //get the object ID of the polyline&lt;BR /&gt;
 es = getObjectAndGsMarker(SectionPolyId, GsMark);&lt;BR /&gt;
&lt;BR /&gt;
 //open the pline for reading&lt;BR /&gt;
 acdbOpenObject(pPline, SectionPolyId, AcDb::kForRead);&lt;BR /&gt;
&lt;BR /&gt;
    // Set up the vertices.&lt;BR /&gt;
    Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
    AcGePoint3d *verts = new AcGePoint3d[(numVerts - 1)];&lt;BR /&gt;
&lt;BR /&gt;
 for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts; vertexNumber++)&lt;BR /&gt;
  {&lt;BR /&gt;
   es = pPline-&amp;gt;getPointAt(vertexNumber, Vertex);&lt;BR /&gt;
   verts[vertexNumber] = Vertex;&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
    pPline-&amp;gt;close();  // Finished with the pline header.&lt;BR /&gt;
&lt;BR /&gt;
 MyDBXObject *pObj;&lt;BR /&gt;
&lt;BR /&gt;
 pObj = new LPLineal;&lt;BR /&gt;
&lt;BR /&gt;
 pObj-&amp;gt;SetCrossSection(verts, numVerts);&lt;BR /&gt;
&lt;BR /&gt;
 es = appendToBlockTable(pObj, LinId, ACDB_MODEL_SPACE, pCurDb);&lt;BR /&gt;
 if(es != Acad::eOk)&lt;BR /&gt;
 {&lt;BR /&gt;
  acutPrintf("\nError drawing My object!");&lt;BR /&gt;
  if(pObj)&lt;BR /&gt;
  {&lt;BR /&gt;
   delete pObj;&lt;BR /&gt;
   return;&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;BR /&gt;
&lt;BR /&gt;
 pObj-&amp;gt;close();&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
this is my dbx object that seems to cause problems:&lt;BR /&gt;
void MyDBXObject::SetCrossSection(AcGePoint3d*&amp;amp; verts, Adesk::UInt32&lt;BR /&gt;
numVerts)&lt;BR /&gt;
{&lt;BR /&gt;
 AcGePoint3d location;&lt;BR /&gt;
 m_numStartSectionVerts = numVerts;&lt;BR /&gt;
 m_StartSectionVerts = verts;&lt;BR /&gt;
&lt;BR /&gt;
 for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts ; vertexNumber++)&lt;BR /&gt;
{&lt;BR /&gt;
  location = m_StartSectionVerts[vertexNumber];&lt;BR /&gt;
  location.z = 10.00;&lt;BR /&gt;
 }&lt;BR /&gt;
}</description>
      <pubDate>Thu, 29 Aug 2002 07:06:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311842#M39588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-29T07:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fatal error</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311843#M39589</link>
      <description>Bill,&lt;BR /&gt;
I don't think you are allocating the correct memory.&lt;BR /&gt;
Unless I'm having a brainstorm Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
will return the number of vertices and the size of the array to allocate.&lt;BR /&gt;
i.e. AcGePoint3d *verts = new AcGePoint3d[numVerts];&lt;BR /&gt;
If you have 6 vertices, then you need to allocate enough memory for 6. 5 is&lt;BR /&gt;
the upper limit on the index, not the size to allocate.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Bill Wright" &lt;W.WRIGHT&gt; wrote in message&lt;BR /&gt;
news:3D6E388A.27C06316@archsky.com...&lt;BR /&gt;
&amp;gt; This is another shot at my last post about pointer problems. This time I&lt;BR /&gt;
&amp;gt; am including the function that is passing the pointer because I think&lt;BR /&gt;
&amp;gt; this is where the real problem is originating. What I'm trying to do is&lt;BR /&gt;
&amp;gt; pass an array of points to my object then that object will ultimately&lt;BR /&gt;
&amp;gt; use those points to set up more points in the object. I can run the&lt;BR /&gt;
&amp;gt; insert function several times without trouble then I will crash.&lt;BR /&gt;
&amp;gt; Sometimes if I unload my program and reload it it will crash after only&lt;BR /&gt;
&amp;gt; running it a few times. Obviously I'm new at this so any help would be&lt;BR /&gt;
&amp;gt; appreciated.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; this is my arx command function:&lt;BR /&gt;
&amp;gt; void InsertMyObject()&lt;BR /&gt;
&amp;gt; {&lt;BR /&gt;
&amp;gt;  AcDbDatabase *pCurDb;&lt;BR /&gt;
&amp;gt;  AcDbObjectId LinId;&lt;BR /&gt;
&amp;gt;  Acad::ErrorStatus es;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  //get the current database&lt;BR /&gt;
&amp;gt;  pCurDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  AcDbObjectId SectionPolyId;&lt;BR /&gt;
&amp;gt;  int GsMark;&lt;BR /&gt;
&amp;gt;  AcDbPolyline *pPline;&lt;BR /&gt;
&amp;gt;  AcGePoint3d Vertex;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  //get the object ID of the polyline&lt;BR /&gt;
&amp;gt;  es = getObjectAndGsMarker(SectionPolyId, GsMark);&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  //open the pline for reading&lt;BR /&gt;
&amp;gt;  acdbOpenObject(pPline, SectionPolyId, AcDb::kForRead);&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     // Set up the vertices.&lt;BR /&gt;
&amp;gt;     Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
&amp;gt;     AcGePoint3d *verts = new AcGePoint3d[(numVerts - 1)];&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts; vertexNumber++)&lt;BR /&gt;
&amp;gt;   {&lt;BR /&gt;
&amp;gt;    es = pPline-&amp;gt;getPointAt(vertexNumber, Vertex);&lt;BR /&gt;
&amp;gt;    verts[vertexNumber] = Vertex;&lt;BR /&gt;
&amp;gt;   }&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     pPline-&amp;gt;close();  // Finished with the pline header.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  MyDBXObject *pObj;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  pObj = new LPLineal;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  pObj-&amp;gt;SetCrossSection(verts, numVerts);&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  es = appendToBlockTable(pObj, LinId, ACDB_MODEL_SPACE, pCurDb);&lt;BR /&gt;
&amp;gt;  if(es != Acad::eOk)&lt;BR /&gt;
&amp;gt;  {&lt;BR /&gt;
&amp;gt;   acutPrintf("\nError drawing My object!");&lt;BR /&gt;
&amp;gt;   if(pObj)&lt;BR /&gt;
&amp;gt;   {&lt;BR /&gt;
&amp;gt;    delete pObj;&lt;BR /&gt;
&amp;gt;    return;&lt;BR /&gt;
&amp;gt;   }&lt;BR /&gt;
&amp;gt;  }&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  pObj-&amp;gt;close();&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; }&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; this is my dbx object that seems to cause problems:&lt;BR /&gt;
&amp;gt; void MyDBXObject::SetCrossSection(AcGePoint3d*&amp;amp; verts, Adesk::UInt32&lt;BR /&gt;
&amp;gt; numVerts)&lt;BR /&gt;
&amp;gt; {&lt;BR /&gt;
&amp;gt;  AcGePoint3d location;&lt;BR /&gt;
&amp;gt;  m_numStartSectionVerts = numVerts;&lt;BR /&gt;
&amp;gt;  m_StartSectionVerts = verts;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;  for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts ; vertexNumber++)&lt;BR /&gt;
&amp;gt; {&lt;BR /&gt;
&amp;gt;   location = m_StartSectionVerts[vertexNumber];&lt;BR /&gt;
&amp;gt;   location.z = 10.00;&lt;BR /&gt;
&amp;gt;  }&lt;BR /&gt;
&amp;gt; }&lt;BR /&gt;
&amp;gt;&lt;/W.WRIGHT&gt;</description>
      <pubDate>Thu, 29 Aug 2002 07:23:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311843#M39589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-29T07:23:43Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311844#M39590</link>
      <description>Thank you David, boy do I feel dumb. That seems to have fixed it.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
&lt;BR /&gt;
David Bartliff wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Bill,&lt;BR /&gt;
&amp;gt; I don't think you are allocating the correct memory.&lt;BR /&gt;
&amp;gt; Unless I'm having a brainstorm Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
&amp;gt; will return the number of vertices and the size of the array to allocate.&lt;BR /&gt;
&amp;gt; i.e. AcGePoint3d *verts = new AcGePoint3d[numVerts];&lt;BR /&gt;
&amp;gt; If you have 6 vertices, then you need to allocate enough memory for 6. 5 is&lt;BR /&gt;
&amp;gt; the upper limit on the index, not the size to allocate.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Bill Wright" &lt;W.WRIGHT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:3D6E388A.27C06316@archsky.com...&lt;BR /&gt;
&amp;gt; &amp;gt; This is another shot at my last post about pointer problems. This time I&lt;BR /&gt;
&amp;gt; &amp;gt; am including the function that is passing the pointer because I think&lt;BR /&gt;
&amp;gt; &amp;gt; this is where the real problem is originating. What I'm trying to do is&lt;BR /&gt;
&amp;gt; &amp;gt; pass an array of points to my object then that object will ultimately&lt;BR /&gt;
&amp;gt; &amp;gt; use those points to set up more points in the object. I can run the&lt;BR /&gt;
&amp;gt; &amp;gt; insert function several times without trouble then I will crash.&lt;BR /&gt;
&amp;gt; &amp;gt; Sometimes if I unload my program and reload it it will crash after only&lt;BR /&gt;
&amp;gt; &amp;gt; running it a few times. Obviously I'm new at this so any help would be&lt;BR /&gt;
&amp;gt; &amp;gt; appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; this is my arx command function:&lt;BR /&gt;
&amp;gt; &amp;gt; void InsertMyObject()&lt;BR /&gt;
&amp;gt; &amp;gt; {&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbDatabase *pCurDb;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbObjectId LinId;&lt;BR /&gt;
&amp;gt; &amp;gt;  Acad::ErrorStatus es;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  //get the current database&lt;BR /&gt;
&amp;gt; &amp;gt;  pCurDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbObjectId SectionPolyId;&lt;BR /&gt;
&amp;gt; &amp;gt;  int GsMark;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcDbPolyline *pPline;&lt;BR /&gt;
&amp;gt; &amp;gt;  AcGePoint3d Vertex;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  //get the object ID of the polyline&lt;BR /&gt;
&amp;gt; &amp;gt;  es = getObjectAndGsMarker(SectionPolyId, GsMark);&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  //open the pline for reading&lt;BR /&gt;
&amp;gt; &amp;gt;  acdbOpenObject(pPline, SectionPolyId, AcDb::kForRead);&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     // Set up the vertices.&lt;BR /&gt;
&amp;gt; &amp;gt;     Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
&amp;gt; &amp;gt;     AcGePoint3d *verts = new AcGePoint3d[(numVerts - 1)];&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts; vertexNumber++)&lt;BR /&gt;
&amp;gt; &amp;gt;   {&lt;BR /&gt;
&amp;gt; &amp;gt;    es = pPline-&amp;gt;getPointAt(vertexNumber, Vertex);&lt;BR /&gt;
&amp;gt; &amp;gt;    verts[vertexNumber] = Vertex;&lt;BR /&gt;
&amp;gt; &amp;gt;   }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     pPline-&amp;gt;close();  // Finished with the pline header.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  MyDBXObject *pObj;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  pObj = new LPLineal;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  pObj-&amp;gt;SetCrossSection(verts, numVerts);&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  es = appendToBlockTable(pObj, LinId, ACDB_MODEL_SPACE, pCurDb);&lt;BR /&gt;
&amp;gt; &amp;gt;  if(es != Acad::eOk)&lt;BR /&gt;
&amp;gt; &amp;gt;  {&lt;BR /&gt;
&amp;gt; &amp;gt;   acutPrintf("\nError drawing My object!");&lt;BR /&gt;
&amp;gt; &amp;gt;   if(pObj)&lt;BR /&gt;
&amp;gt; &amp;gt;   {&lt;BR /&gt;
&amp;gt; &amp;gt;    delete pObj;&lt;BR /&gt;
&amp;gt; &amp;gt;    return;&lt;BR /&gt;
&amp;gt; &amp;gt;   }&lt;BR /&gt;
&amp;gt; &amp;gt;  }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  pObj-&amp;gt;close();&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; this is my dbx object that seems to cause problems:&lt;BR /&gt;
&amp;gt; &amp;gt; void MyDBXObject::SetCrossSection(AcGePoint3d*&amp;amp; verts, Adesk::UInt32&lt;BR /&gt;
&amp;gt; &amp;gt; numVerts)&lt;BR /&gt;
&amp;gt; &amp;gt; {&lt;BR /&gt;
&amp;gt; &amp;gt;  AcGePoint3d location;&lt;BR /&gt;
&amp;gt; &amp;gt;  m_numStartSectionVerts = numVerts;&lt;BR /&gt;
&amp;gt; &amp;gt;  m_StartSectionVerts = verts;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;  for (int vertexNumber = 0; vertexNumber &amp;lt; numVerts ; vertexNumber++)&lt;BR /&gt;
&amp;gt; &amp;gt; {&lt;BR /&gt;
&amp;gt; &amp;gt;   location = m_StartSectionVerts[vertexNumber];&lt;BR /&gt;
&amp;gt; &amp;gt;   location.z = 10.00;&lt;BR /&gt;
&amp;gt; &amp;gt;  }&lt;BR /&gt;
&amp;gt; &amp;gt; }&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;/W.WRIGHT&gt;</description>
      <pubDate>Thu, 29 Aug 2002 10:05:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311844#M39590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-29T10:05:24Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311845#M39591</link>
      <description>Bill Wright &lt;W.WRIGHT&gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;BR /&gt;
&amp;gt;&amp;gt;&amp;gt;     // Set up the vertices.&lt;BR /&gt;
&amp;gt;&amp;gt;&amp;gt;     Adesk::UInt32 numVerts = pPline-&amp;gt;numVerts();&lt;BR /&gt;
&amp;gt;&amp;gt;&amp;gt;     AcGePoint3d *verts = new AcGePoint3d[(numVerts - 1)];&lt;BR /&gt;
Why, don't you use 'AcGePoint3dArray'?&lt;BR /&gt;
It's easy to handle and much more safer then allocation your own array.&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;/W.WRIGHT&gt;</description>
      <pubDate>Thu, 29 Aug 2002 10:38:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/fatal-error/m-p/311845#M39591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-29T10:38:12Z</dc:date>
    </item>
  </channel>
</rss>

