<?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: Copy/Paste on custom entity in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258019#M19083</link>
    <description>It's also possible that the handle might be valid in the target drawing, but &lt;BR /&gt;
it isn't for the same object that it was in the source drawing.  So, even if &lt;BR /&gt;
you do determine that the handle is valid, you still might not be getting &lt;BR /&gt;
what you expect.&lt;BR /&gt;
&lt;BR /&gt;
You're better off using an ObjectId since they are not database specific as &lt;BR /&gt;
handles are.&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXB&gt; wrote in message news:5934071@discussion.autodesk.com...&lt;BR /&gt;
Hi&lt;BR /&gt;
class XEl public AcDbEntity {&lt;BR /&gt;
.....&lt;BR /&gt;
AcGePoint3d ;&lt;BR /&gt;
AcDbHandle;//handle to another custom entity (another class)&lt;BR /&gt;
......&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
Now, when we perform a Copy/Paste sequence to another drawing, the &lt;BR /&gt;
XEl::worldDraw() is called, it tries to open the entity pointed to by the &lt;BR /&gt;
member handle and of course errors out.&lt;BR /&gt;
The curious part is that the error is Acad::eWasErased when in fact the &lt;BR /&gt;
entity is nonexistent.&lt;BR /&gt;
Any good explanation?&lt;BR /&gt;
BTW, the solution would be the same (create a new entity and point the &lt;BR /&gt;
handle at it) but I'd like to know if there is a way do distinguish between &lt;BR /&gt;
an erased entity and a nonexistent one.&lt;BR /&gt;
&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
    <pubDate>Sun, 18 May 2008 01:50:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-05-18T01:50:13Z</dc:date>
    <item>
      <title>Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258018#M19082</link>
      <description>Hi&lt;BR /&gt;
class XEl public AcDbEntity {&lt;BR /&gt;
.....&lt;BR /&gt;
AcGePoint3d	;&lt;BR /&gt;
AcDbHandle;//handle to another custom entity (another class)&lt;BR /&gt;
......&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
Now, when we perform a Copy/Paste sequence to another drawing, the XEl::worldDraw() is called, it tries to open the entity pointed to by the member handle and of course errors out.&lt;BR /&gt;
The curious part is that the error is Acad::eWasErased when in fact the entity is nonexistent.&lt;BR /&gt;
Any good explanation?&lt;BR /&gt;
BTW, the solution would be the same (create a new entity and point the handle at it) but I'd like to know if there is a way do distinguish between an erased entity and a nonexistent one.&lt;BR /&gt;
&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Sat, 17 May 2008 20:01:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258018#M19082</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-17T20:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258019#M19083</link>
      <description>It's also possible that the handle might be valid in the target drawing, but &lt;BR /&gt;
it isn't for the same object that it was in the source drawing.  So, even if &lt;BR /&gt;
you do determine that the handle is valid, you still might not be getting &lt;BR /&gt;
what you expect.&lt;BR /&gt;
&lt;BR /&gt;
You're better off using an ObjectId since they are not database specific as &lt;BR /&gt;
handles are.&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXB&gt; wrote in message news:5934071@discussion.autodesk.com...&lt;BR /&gt;
Hi&lt;BR /&gt;
class XEl public AcDbEntity {&lt;BR /&gt;
.....&lt;BR /&gt;
AcGePoint3d ;&lt;BR /&gt;
AcDbHandle;//handle to another custom entity (another class)&lt;BR /&gt;
......&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
Now, when we perform a Copy/Paste sequence to another drawing, the &lt;BR /&gt;
XEl::worldDraw() is called, it tries to open the entity pointed to by the &lt;BR /&gt;
member handle and of course errors out.&lt;BR /&gt;
The curious part is that the error is Acad::eWasErased when in fact the &lt;BR /&gt;
entity is nonexistent.&lt;BR /&gt;
Any good explanation?&lt;BR /&gt;
BTW, the solution would be the same (create a new entity and point the &lt;BR /&gt;
handle at it) but I'd like to know if there is a way do distinguish between &lt;BR /&gt;
an erased entity and a nonexistent one.&lt;BR /&gt;
&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
      <pubDate>Sun, 18 May 2008 01:50:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258019#M19083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T01:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258020#M19084</link>
      <description>Art&lt;BR /&gt;
The question was, why did we get Acad::eWasErased. The database pasted to was new and clean, so the handle was not valid and surely not erased.&lt;BR /&gt;
About using ObjectId, good suggestion, will implement.&lt;BR /&gt;
&lt;BR /&gt;
BTW, how do we append an entity to the current space (model or paper). I mean w/o explicitly using ACDB_MODEL_SPACE etc.?&lt;BR /&gt;
&lt;BR /&gt;
I see I am flooding the group with questions, we are in the middle of the prog writing and questions arise faster than the answers. Sorry.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Sun, 18 May 2008 05:34:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258020#M19084</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-18T05:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258021#M19085</link>
      <description>Are you sure it was eWasErased and not eWasPermanentlyErased?  It should &lt;BR /&gt;
return eWasPermanentlyErased which indicates that the object does not exist.&lt;BR /&gt;
&lt;BR /&gt;
There is no shortcut to append to the current space.  You must figure out &lt;BR /&gt;
what BlockTableRecord is the current space and then append to it.  If the &lt;BR /&gt;
drawing is the current drawing in the editor, then you should be able to use &lt;BR /&gt;
the AcDbLayoutManager::getActiveLayoutBTRId() to get the objectId of the &lt;BR /&gt;
current layout's BlockTableRecord.&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXB&gt; wrote in message news:5934122@discussion.autodesk.com...&lt;BR /&gt;
Art&lt;BR /&gt;
The question was, why did we get Acad::eWasErased. The database pasted to &lt;BR /&gt;
was new and clean, so the handle was not valid and surely not erased.&lt;BR /&gt;
About using ObjectId, good suggestion, will implement.&lt;BR /&gt;
&lt;BR /&gt;
BTW, how do we append an entity to the current space (model or paper). I &lt;BR /&gt;
mean w/o explicitly using ACDB_MODEL_SPACE etc.?&lt;BR /&gt;
&lt;BR /&gt;
I see I am flooding the group with questions, we are in the middle of the &lt;BR /&gt;
prog writing and questions arise faster than the answers. Sorry.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
      <pubDate>Sun, 18 May 2008 06:15:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258021#M19085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T06:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258022#M19086</link>
      <description>Art&lt;BR /&gt;
I double checked, and it indeed is eWasErased.&lt;BR /&gt;
code from helper routine:&lt;BR /&gt;
//try to open the entity from handle and get data from it&lt;BR /&gt;
pCurDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();&lt;BR /&gt;
es = pCurDb-&amp;gt;getAcDbObjectId(objId, Adesk::kFalse, handle, 0);//ObjectId from handle&lt;BR /&gt;
if (es == Acad::eWasErased)//it errors here&lt;BR /&gt;
{&lt;BR /&gt;
MSG("getBaselineEnt():getAcDbObjectId: eWasErased\n");&lt;BR /&gt;
return NULL;&lt;BR /&gt;
}&lt;BR /&gt;
....&lt;BR /&gt;
&lt;BR /&gt;
Now this is strange and I agree that it should have been eWasPermanentlyErased. The problem now is that if we could know the pasting was ocurring in another drawing (not the one the Copy was performed in) ,we could find a sollution, but if we are getting the wrong error code.....&lt;BR /&gt;
As the secondary entity, the one whose handle is missing - rased or nonexistent - is vital, we have to create a valid one anyway, which raises another problem:&lt;BR /&gt;
The above attempt to open the secondary entity is made in the main entity's worldDraw() method. Now, if the secondary entity is missing, creating it involves user input. The question is, is it possible and/or advisable to remain in worldDraw long enough to get user's response? I seem to have read somewhere that worldDraw has to return as fast as possible.&lt;BR /&gt;
&lt;BR /&gt;
As about appending to the current layout, I'm not sure I understood you. Is there some code snippet, maybe in the samples?&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Sun, 18 May 2008 13:40:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258022#M19086</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-18T13:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258023#M19087</link>
      <description>Alex:&lt;BR /&gt;
&lt;BR /&gt;
  Your dependent entity needs to be referenced via object ID, and filed &lt;BR /&gt;
during filing operations using the appropriate reference type to avoid this &lt;BR /&gt;
whole problem.  You can use AcDbDatabase::currentSpaceId() to get the &lt;BR /&gt;
current BTR. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;/&gt;&lt;/&gt;</description>
      <pubDate>Sun, 18 May 2008 13:53:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258023#M19087</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T13:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258024#M19088</link>
      <description>Owen&lt;BR /&gt;
&lt;BR /&gt;
The secondary object is referenced by many instances of the main object. It should be cloned only when pasting an instance of the main object to another db. Except this, the new copy, if made in the same db, is quite happy with the current handle (or object ID).&lt;BR /&gt;
&lt;BR /&gt;
 Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Sun, 18 May 2008 14:02:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258024#M19088</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-18T14:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258025#M19089</link>
      <description>There's also acedGetCurrentSpaceId()&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
"Art Cooney" &lt;ARTC&gt; wrote in message news:5934132@discussion.autodesk.com...&lt;BR /&gt;
Are you sure it was eWasErased and not eWasPermanentlyErased?  It should &lt;BR /&gt;
return eWasPermanentlyErased which indicates that the object does not exist.&lt;BR /&gt;
&lt;BR /&gt;
There is no shortcut to append to the current space.  You must figure out &lt;BR /&gt;
what BlockTableRecord is the current space and then append to it.  If the &lt;BR /&gt;
drawing is the current drawing in the editor, then you should be able to use &lt;BR /&gt;
the AcDbLayoutManager::getActiveLayoutBTRId() to get the objectId of the &lt;BR /&gt;
current layout's BlockTableRecord.&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXB&gt; wrote in message news:5934122@discussion.autodesk.com...&lt;BR /&gt;
Art&lt;BR /&gt;
The question was, why did we get Acad::eWasErased. The database pasted to &lt;BR /&gt;
was new and clean, so the handle was not valid and surely not erased.&lt;BR /&gt;
About using ObjectId, good suggestion, will implement.&lt;BR /&gt;
&lt;BR /&gt;
BTW, how do we append an entity to the current space (model or paper). I &lt;BR /&gt;
mean w/o explicitly using ACDB_MODEL_SPACE etc.?&lt;BR /&gt;
&lt;BR /&gt;
I see I am flooding the group with questions, we are in the middle of the &lt;BR /&gt;
prog writing and questions arise faster than the answers. Sorry.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;&lt;/ARTC&gt;</description>
      <pubDate>Sun, 18 May 2008 14:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258025#M19089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T14:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258026#M19090</link>
      <description>"Owen Wengerd" &lt;OWENW&gt; wrote &lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&amp;gt; You can use AcDbDatabase::currentSpaceId() to get the &lt;BR /&gt;
current BTR. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &amp;lt;&amp;lt;&lt;BR /&gt;
&lt;BR /&gt;
Owen - You might want to see this recent post here:&lt;BR /&gt;
&lt;BR /&gt;
   BUG: AcDbDatabase::currentSpaceId() returns incorrect value&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
"Owen Wengerd" &lt;OWENW&gt; wrote in message news:5934180@discussion.autodesk.com...&lt;BR /&gt;
Alex:&lt;BR /&gt;
&lt;BR /&gt;
  Your dependent entity needs to be referenced via object ID, and filed &lt;BR /&gt;
during filing operations using the appropriate reference type to avoid this &lt;BR /&gt;
whole problem.  You can use AcDbDatabase::currentSpaceId() to get the &lt;BR /&gt;
current BTR. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;/&gt;&lt;/&gt;&lt;/OWENW&gt;&lt;/OWENW&gt;</description>
      <pubDate>Sun, 18 May 2008 14:22:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258026#M19090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T14:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258027#M19091</link>
      <description>Just a note about appending to the 'current' space, do not rely on&lt;BR /&gt;
AcDbDatabase::currentSpaceId() returning the correct value, if the &lt;BR /&gt;
AcDbDatabase is not the current working database.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXB&gt; wrote in message news:5934122@discussion.autodesk.com...&lt;BR /&gt;
Art&lt;BR /&gt;
The question was, why did we get Acad::eWasErased. The database pasted to was new and clean, so the handle was not valid and surely not erased.&lt;BR /&gt;
About using ObjectId, good suggestion, will implement.&lt;BR /&gt;
&lt;BR /&gt;
BTW, how do we append an entity to the current space (model or paper). I mean w/o explicitly using ACDB_MODEL_SPACE etc.?&lt;BR /&gt;
&lt;BR /&gt;
I see I am flooding the group with questions, we are in the middle of the prog writing and questions arise faster than the answers. Sorry.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
      <pubDate>Sun, 18 May 2008 14:22:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258027#M19091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T14:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258028#M19092</link>
      <description>Alex:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; The secondary object is referenced by many instances of the main object.&lt;BR /&gt;
&lt;BR /&gt;
  Then it should be either a SoftPointerId or a HardPointerId, depending on &lt;BR /&gt;
whether the referencing object works correctly with a non-existent &lt;BR /&gt;
reference. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;/&gt;&lt;/&gt;</description>
      <pubDate>Sun, 18 May 2008 16:40:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258028#M19092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T16:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258029#M19093</link>
      <description>Tony:&lt;BR /&gt;
&lt;BR /&gt;
  I do recall that post.  Thanks for the reminder. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;/&gt;&lt;/&gt;</description>
      <pubDate>Sun, 18 May 2008 16:42:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258029#M19093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T16:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258030#M19094</link>
      <description>Owen&lt;BR /&gt;
&lt;BR /&gt;
I don't see the connection to the kind of ptr used, so I think I explained badly the whole thing. I'll try again:&lt;BR /&gt;
We have 2 custom entitties, Main and Secondary. The Main ent has a data member pointing to an instance of the Secondary ent.&lt;BR /&gt;
The reference has to be valid for the Main ent to work, although an invalid ref won't cause a crash.&lt;BR /&gt;
The Main ent uses the reference only during worldDraw().&lt;BR /&gt;
&lt;BR /&gt;
Now, the user opens 2 new clean dwgs, A and B, and in A  creates an instance of the Main ent. She will be asked to create a Secondary ent also, and a pointer to it will be stored in the Main ent data member.&lt;BR /&gt;
Now Copy the Main ent, move over to B dwg and Paste it there.&lt;BR /&gt;
The Main ent gets copied there, bad handle and all. When it tries to worldDraw() itself, it errors out on an invalid handle.&lt;BR /&gt;
OK thus far.&lt;BR /&gt;
The problems:&lt;BR /&gt;
 1. why is the error eWasErased (there never were any ents in this dwg)? If we are to find a solution we have to know if it was indeed erased and we can unerase it, or it never existed and we have to create a new one.&lt;BR /&gt;
2. Supposing we solve 1. above: in order to create a new Secondary ent we need user input, and the question was : can we stay in worldDraw() indefinitely (until the user makes up her mind)?&lt;BR /&gt;
&lt;BR /&gt;
Regardless, using AcDbDatabase::currentSpaceId() is not a problem here, as we append only to the current working db.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;BR /&gt;
&lt;BR /&gt;
null</description>
      <pubDate>Sun, 18 May 2008 20:45:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258030#M19094</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-18T20:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258031#M19095</link>
      <description>Alex:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I don't see the connection to the kind of ptr used...&lt;BR /&gt;
&lt;BR /&gt;
  From your description, it sounds like the "data member" should be an &lt;BR /&gt;
AcDbHardPointerId.  If you fix the flawed design of your entity class in the &lt;BR /&gt;
way that I suggested, all these other problems will no longer exist. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;/&gt;&lt;/&gt;</description>
      <pubDate>Sun, 18 May 2008 22:51:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258031#M19095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-18T22:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258032#M19096</link>
      <description>Owen&lt;BR /&gt;
You are probably right in principle about using pointers instead of handles.&lt;BR /&gt;
But, in this particular case I don't think a hard pointer will do, as it will cause the cloning of the pointed-to entity for every Copy command, which I specifically don't want.&lt;BR /&gt;
Moreover, are you saying that using pointers will solve the problem of Autocad returning the wrong error code?&lt;BR /&gt;
What I need is a way of knowing for sure if the entity pointed-to by the handle/pointer was erased (and can be resuscitated) or never existed.&lt;BR /&gt;
In any case, could you refer to my question about waiting for user input inside worldDraw()?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Mon, 19 May 2008 18:09:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258032#M19096</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-19T18:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258033#M19097</link>
      <description>You can't safely solicit user input during a worldDraw().  The various user &lt;BR /&gt;
input functions should error out, but I'm not sure that they will do so.&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXB&gt; wrote in message news:5934816@discussion.autodesk.com...&lt;BR /&gt;
Owen&lt;BR /&gt;
You are probably right in principle about using pointers instead of handles.&lt;BR /&gt;
But, in this particular case I don't think a hard pointer will do, as it &lt;BR /&gt;
will cause the cloning of the pointed-to entity for every Copy command, &lt;BR /&gt;
which I specifically don't want.&lt;BR /&gt;
Moreover, are you saying that using pointers will solve the problem of &lt;BR /&gt;
Autocad returning the wrong error code?&lt;BR /&gt;
What I need is a way of knowing for sure if the entity pointed-to by the &lt;BR /&gt;
handle/pointer was erased (and can be resuscitated) or never existed.&lt;BR /&gt;
In any case, could you refer to my question about waiting for user input &lt;BR /&gt;
inside worldDraw()?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
      <pubDate>Mon, 19 May 2008 19:07:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258033#M19097</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-19T19:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258034#M19098</link>
      <description>Art&lt;BR /&gt;
Thank you for the clarification. Now I have a big problem :).&lt;BR /&gt;
About getting eWasErased instead of eWasPermanentlyErased, could you comment?&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Tue, 20 May 2008 02:28:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258034#M19098</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-20T02:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258035#M19099</link>
      <description>Alex:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; But, in this particular case I don't think a hard pointer will do,&lt;BR /&gt;
&amp;gt; as it will cause the cloning of the pointed-to entity for every&lt;BR /&gt;
&amp;gt; Copy command, which I specifically don't want.&lt;BR /&gt;
&lt;BR /&gt;
  Have you tried it?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Moreover, are you saying that using pointers will solve the&lt;BR /&gt;
&amp;gt; problem of Autocad returning the wrong error code?&lt;BR /&gt;
&lt;BR /&gt;
  Yes, that is what I am saying. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;/&gt;&lt;/&gt;</description>
      <pubDate>Tue, 20 May 2008 03:23:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258035#M19099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-20T03:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258036#M19100</link>
      <description>As Owen and I have both said, you should use an objectId not a handle.  That &lt;BR /&gt;
will eliminate this problem.  If you don't the referenced entity to be &lt;BR /&gt;
cloned by wblock, then use a softPointerId. A soft pointer id will be set to &lt;BR /&gt;
null in the target drawing if the object it refers to was not part of the &lt;BR /&gt;
cloning operation.  So, you could simply use the AcDbObjectId::isNull() &lt;BR /&gt;
method to determine if the referenced entity was copied to the target &lt;BR /&gt;
drawing or not.&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXB&gt; wrote in message news:5935247@discussion.autodesk.com...&lt;BR /&gt;
Art&lt;BR /&gt;
Thank you for the clarification. Now I have a big problem :).&lt;BR /&gt;
About getting eWasErased instead of eWasPermanentlyErased, could you &lt;BR /&gt;
comment?&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
alex&lt;/ALEXB&gt;</description>
      <pubDate>Tue, 20 May 2008 20:10:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258036#M19100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-05-20T20:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Copy/Paste on custom entity</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258037#M19101</link>
      <description>OK, I will try doing it with object ID's, and post here the results.&lt;BR /&gt;
Thank you, Art and Owen.&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Wed, 21 May 2008 00:27:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/copy-paste-on-custom-entity/m-p/2258037#M19101</guid>
      <dc:creator>alex_b</dc:creator>
      <dc:date>2008-05-21T00:27:45Z</dc:date>
    </item>
  </channel>
</rss>

