<?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: Document.ObjectReappended , how it work? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6423875#M35447</link>
    <description>&lt;P&gt;Exactly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I remove an object and then I do UNDO, that event was wrong for this scenario but I don´t know what event use for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2016 15:15:22 GMT</pubDate>
    <dc:creator>joantopo</dc:creator>
    <dc:date>2016-07-07T15:15:22Z</dc:date>
    <item>
      <title>Document.ObjectReappended , how it work?</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6423396#M35445</link>
      <description>&lt;P&gt;I have this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    doc.Database.ObjectReappended += new ObjectEventHandler(MainForm.callback_ObjectReAppended);&lt;/PRE&gt;
&lt;P&gt;And I have a break point in Visual Studio in the "callback_ObjectReAppended" method, but I remove some objects of the drawing and then press "UNDO" &amp;nbsp;(CTRL+Z) but there is no way to fire this event.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 11:17:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6423396#M35445</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-07-07T11:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ObjectReappended , how it work?</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6423748#M35446</link>
      <description>&lt;P&gt;Here is what the ObjectARX Document says on Database.ObjectReappended event:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Wraps AcDbDatabaseReactor::objectReAppended. The event is invoked when an object has had its addition to the database dwg undone during an Undo operation, and has now been re-appended to the database due to an execution of the AutoCAD REDO command.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like, your event handler would be called only when REDO command is executed AND when there is object is unappened by UNDO command (i.e. there is object was appended to database prior to UNDO command execution). So, your described scenario (erasing something from database and then using UNDO command to get them back) probably not triggers Database.Reappended event, according to the document's description.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 14:27:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6423748#M35446</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2016-07-07T14:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ObjectReappended , how it work?</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6423875#M35447</link>
      <description>&lt;P&gt;Exactly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I remove an object and then I do UNDO, that event was wrong for this scenario but I don´t know what event use for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 15:15:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6423875#M35447</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2016-07-07T15:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ObjectReappended , how it work?</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6424208#M35448</link>
      <description>&lt;P&gt;The ObjectErased event fires when the object is erased, AND when it is Unerased (UNDO &amp;amp; Oops both fire this).&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 18:00:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6424208#M35448</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2016-07-07T18:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ObjectReappended , how it work?</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6855861#M35449</link>
      <description>&lt;P&gt;Hi Jeff.&lt;/P&gt;
&lt;P&gt;Yes, your comment is right and I am using it in my LAM addon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there is the following scenario when ObjectErased is not triggered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You create an alignment, then you do some operations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do MULTIPLE Undo until the alignment dissapears in the drawing, then ObjectErased event is not fired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a bool global variable called "UNDO_afterErased=false; that I put it within&amp;nbsp;the method of ObjectErased event and then this variable is true.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I have the CommandEnded event:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  public static void doc_CommandEnded(object sender, CommandEventArgs e)
        {
          
            if (e.GlobalCommandName == "UNDO")  //ES EL UNDO
            {

                if (variables.UNDO_afterErased== false)
                {
                    //hacer las operaciones
                 
                }
                else //si es true ponerlo de nuevo a false
                {
                    variables_globales.UNDO_afterErased = false;
                }
            }&lt;BR /&gt;       }&lt;/PRE&gt;
&lt;P&gt;I am following this thread:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/autocad/2013/01/monitoring-object-during-undoredo-with-net-api.html" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2013/01/monitoring-object-during-undoredo-with-net-api.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, when the UNDO doesn´t fire ObjectErased Event, (I have to check with ObjectReappended event if the recover entity is really an alignment type and update my XRecord and array var.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When ObjectErased is fired, there is no problem because the XRecord is updated automatically.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 02:21:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-objectreappended-how-it-work/m-p/6855861#M35449</guid>
      <dc:creator>joantopo</dc:creator>
      <dc:date>2017-02-06T02:21:41Z</dc:date>
    </item>
  </channel>
</rss>

