<?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: ObjectModified Event Handler in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473367#M70913</link>
    <description>I have determined that the Event Handler is being called twice for each AttributeReference attached to the object.&lt;BR /&gt;
The sequence seems to be:&lt;BR /&gt;
Select the block.&lt;BR /&gt;
EATTEDIT on it&lt;BR /&gt;
Go to Attribute 1 and change value&lt;BR /&gt;
ObjectModified event handler fires for AttributeReference&lt;BR /&gt;
ObjectModified event handler fires for AttributeReference Again!&lt;BR /&gt;
Select OK&lt;BR /&gt;
&lt;BR /&gt;
The questions now are:&lt;BR /&gt;
Why does the event fire twice for each AttributeReference?&lt;BR /&gt;
Can the BlockReference or objectId of the block the AttributeReference is in be determined from the AttributeReference?</description>
    <pubDate>Wed, 22 Apr 2009 18:42:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-04-22T18:42:14Z</dc:date>
    <item>
      <title>ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473366#M70912</link>
      <description>I am writing a C# program to monitor the blocks that are inserted on a specific layer (PIDSYM) and that have an attribute Tag attached called "DEVICE_NAME".  I need to know when a given blocks attribute values have been modified.  I have added a couple of Event Handlers to DocumentManager_DocumentActivated.  The ObjectAppended event works fine, but when I put the ObjectModified event handler in the code below in it goes into an infinite loop and displays the MessageBox statement over and over.  I have to kill AutoCAD to get out of the loop.&lt;BR /&gt;
Here is the code (The attachment contains the code as well in case the {code} tags don't take):&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
private void DocumentManager_DocumentActivated(object sender, Autodesk.AutoCAD.ApplicationServices.DocumentCollectionEventArgs e)&lt;BR /&gt;
{&lt;BR /&gt;
            //Get a reference to the current document's database&lt;BR /&gt;
            Database activeDatabase = AcadApp.DocumentManager.MdiActiveDocument.Database;&lt;BR /&gt;
            &lt;BR /&gt;
            //Add the event handler&lt;BR /&gt;
            activeDatabase.ObjectModified += new ObjectEventHandler(OnObjectModified);&lt;BR /&gt;
}&lt;BR /&gt;
				&lt;BR /&gt;
				&lt;BR /&gt;
        private void OnObjectModified(object sender, ObjectEventArgs e)&lt;BR /&gt;
        {&lt;BR /&gt;
            //If the object is already open for write then some other&lt;BR /&gt;
            //process has it so quit until it is done&lt;BR /&gt;
            if (e.DBObject.IsWriteEnabled) return;&lt;BR /&gt;
&lt;BR /&gt;
            //Is the object modified a block&lt;BR /&gt;
            if (e.DBObject is BlockReference)&lt;BR /&gt;
            {&lt;BR /&gt;
                //Set up a reference to the current drawing's database&lt;BR /&gt;
                Database db = AcadApp.DocumentManager.MdiActiveDocument.Database;&lt;BR /&gt;
&lt;BR /&gt;
                //Set up a transaction envelope and START it&lt;BR /&gt;
                using (Transaction tm = db.TransactionManager.StartTransaction())&lt;BR /&gt;
                {&lt;BR /&gt;
                    try&lt;BR /&gt;
                    {&lt;BR /&gt;
                        //Create a reference to the block object passed in&lt;BR /&gt;
                        BlockReference blkRef = e.DBObject as BlockReference;&lt;BR /&gt;
&lt;BR /&gt;
                        //Open it for reading&lt;BR /&gt;
                        blkRef.UpgradeOpen();&lt;BR /&gt;
&lt;BR /&gt;
                        //Is it on the PIDSYM layer, if not ignore it&lt;BR /&gt;
                        if (blkRef.Layer.Equals("PIDSYM"))&lt;BR /&gt;
                        {&lt;BR /&gt;
                            //Get the attributes off of the block reference&lt;BR /&gt;
                            Autodesk.AutoCAD.DatabaseServices.AttributeCollection blockAttrs = blkRef.AttributeCollection;&lt;BR /&gt;
&lt;BR /&gt;
                            //Only want the blocks that have DEVICE_NAME as the first tag&lt;BR /&gt;
                            //Set up a reference to the first objectID in the list and open it for reading&lt;BR /&gt;
                            AttributeReference attFirst = (AttributeReference)tm.GetObject(blockAttrs[0], OpenMode.ForRead);&lt;BR /&gt;
&lt;BR /&gt;
                            //Check the attribute reference tag&lt;BR /&gt;
                            if (attFirst.Tag.Equals("DEVICE_NAME"))&lt;BR /&gt;
                            {&lt;BR /&gt;
                                //Need a var to put the block data into&lt;BR /&gt;
                                String attributeData = "";&lt;BR /&gt;
&lt;BR /&gt;
                                //Cycle through the attribute objectIDs &lt;BR /&gt;
                                foreach (ObjectId attrID in blockAttrs)&lt;BR /&gt;
                                {&lt;BR /&gt;
                                    //Create a reference to the attribute and open it for reading&lt;BR /&gt;
                                    AttributeReference attRefers = (AttributeReference)tm.GetObject(attrID, OpenMode.ForRead);&lt;BR /&gt;
&lt;BR /&gt;
                                    //Append the data fields together&lt;BR /&gt;
                                    attributeData += attRefers.TextString + "|";&lt;BR /&gt;
&lt;BR /&gt;
                                } //End foreach attrID&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                                MessageBox.Show("Modified Block: " + attributeData);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                            } //End If attFirst&lt;BR /&gt;
&lt;BR /&gt;
                        } //End If blkRef&lt;BR /&gt;
                    }&lt;BR /&gt;
                    catch (System.Exception ex)&lt;BR /&gt;
                    {&lt;BR /&gt;
                        MessageBox.Show("Error in OnObjectModified:: " + ex.ToString());&lt;BR /&gt;
                    }&lt;BR /&gt;
&lt;BR /&gt;
                } //End Using Transaction tm&lt;BR /&gt;
&lt;BR /&gt;
            } //End If e.DBObject&lt;BR /&gt;
&lt;BR /&gt;
        } //End Method OnObjectModified&lt;BR /&gt;
&lt;BR /&gt;
{code}</description>
      <pubDate>Wed, 22 Apr 2009 16:39:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473366#M70912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-22T16:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473367#M70913</link>
      <description>I have determined that the Event Handler is being called twice for each AttributeReference attached to the object.&lt;BR /&gt;
The sequence seems to be:&lt;BR /&gt;
Select the block.&lt;BR /&gt;
EATTEDIT on it&lt;BR /&gt;
Go to Attribute 1 and change value&lt;BR /&gt;
ObjectModified event handler fires for AttributeReference&lt;BR /&gt;
ObjectModified event handler fires for AttributeReference Again!&lt;BR /&gt;
Select OK&lt;BR /&gt;
&lt;BR /&gt;
The questions now are:&lt;BR /&gt;
Why does the event fire twice for each AttributeReference?&lt;BR /&gt;
Can the BlockReference or objectId of the block the AttributeReference is in be determined from the AttributeReference?</description>
      <pubDate>Wed, 22 Apr 2009 18:42:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473367#M70913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-22T18:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473368#M70914</link>
      <description>Sorry, your code is unreadable in a newsreader.&lt;BR /&gt;
&lt;BR /&gt;
If you want to post a copy of it in an attached text file, then&lt;BR /&gt;
those here using newsreaders might be able to help.&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message &lt;BR /&gt;
news:6168065@discussion.autodesk.com...&lt;BR /&gt;
I have determined that the Event Handler is being called twice for each &lt;BR /&gt;
AttributeReference attached to the object. The sequence seems to be: Select &lt;BR /&gt;
the block. EATTEDIT on it Go to Attribute 1 and change value ObjectModified &lt;BR /&gt;
event handler fires for AttributeReference ObjectModified event handler &lt;BR /&gt;
fires for AttributeReference Again! Select OK The questions now are: Why &lt;BR /&gt;
does the event fire twice for each AttributeReference? Can the &lt;BR /&gt;
BlockReference or objectId of the block the AttributeReference is in be &lt;BR /&gt;
determined from the AttributeReference?&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Thu, 23 Apr 2009 05:41:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473368#M70914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-23T05:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473369#M70915</link>
      <description>Tony,&lt;BR /&gt;
The current code sequence is attached.&lt;BR /&gt;
&lt;BR /&gt;
The main issue is:  How do I determine what block the modified attribute is attached to?</description>
      <pubDate>Thu, 23 Apr 2009 15:55:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473369#M70915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-23T15:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473370#M70916</link>
      <description>The OwnerId property of an AttributeReference holds the&lt;BR /&gt;
ObjectId of the BlockReference.&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message &lt;BR /&gt;
news:6168883@discussion.autodesk.com...&lt;BR /&gt;
Tony, The current code sequence is attached. The main issue is: How do I &lt;BR /&gt;
determine what block the modified attribute is attached to?&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Thu, 23 Apr 2009 19:21:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473370#M70916</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-23T19:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473371#M70917</link>
      <description>No, no, no....That's way too easy.&lt;BR /&gt;
&lt;BR /&gt;
Thanks Tony.&lt;BR /&gt;
&lt;BR /&gt;
Any idea why the ObjectModified event gets fired twice for each object that is modified?&lt;BR /&gt;
&lt;BR /&gt;
Why would the DocumentManager_DocumentActivated event get called twice when I switch from one open drawing to another?</description>
      <pubDate>Thu, 23 Apr 2009 19:56:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473371#M70917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-23T19:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473372#M70918</link>
      <description>There are plenty of circumstances where there may&lt;BR /&gt;
be multiple modifications to an object, like for example,&lt;BR /&gt;
a VBA macro that sets its properties (each property&lt;BR /&gt;
that's set will trigger an ObjectModified notification).&lt;BR /&gt;
&lt;BR /&gt;
So, you have to store the ObjectIds of the objects that&lt;BR /&gt;
have sent the notification one or more times in a collection,&lt;BR /&gt;
and after the operation has completed, then you act on the&lt;BR /&gt;
collection and do your stuff.&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message &lt;BR /&gt;
news:6169145@discussion.autodesk.com...&lt;BR /&gt;
No, no, no....That's way too easy. Thanks Tony. Any idea why the &lt;BR /&gt;
ObjectModified event gets fired twice for each object that is modified? Why &lt;BR /&gt;
would the DocumentManager_DocumentActivated event get called twice when I &lt;BR /&gt;
switch from one open drawing to another?&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Fri, 24 Apr 2009 02:09:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473372#M70918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-24T02:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473373#M70919</link>
      <description>Originally you were asking why the 'ObjectModified' event fires more than &lt;BR /&gt;
once for the same object.&lt;BR /&gt;
&lt;BR /&gt;
After looking more closely at your code, the reason is because you are &lt;BR /&gt;
adding the event handler for the ObjectModified event to the Database more &lt;BR /&gt;
than once, and so the event fires once for each time you've added the &lt;BR /&gt;
handler.&lt;BR /&gt;
&lt;BR /&gt;
The mistake you're making is adding an ObjectModified event handler in the &lt;BR /&gt;
DocumentActivated event.  That event fires *every* time you switch documents &lt;BR /&gt;
or just bring AutoCAD into the foreground,  If you add the ObjectModified &lt;BR /&gt;
event handler from that event, it will be added multipole times, every time &lt;BR /&gt;
the document window is activated, which means that it will fire as many &lt;BR /&gt;
times as you've added the handler.&lt;BR /&gt;
&lt;BR /&gt;
You can only add an event handler to an event *once*. If you fail to follow &lt;BR /&gt;
that rule, the event is going to fire multiple times (once for each time you &lt;BR /&gt;
added the handler).&lt;BR /&gt;
&lt;BR /&gt;
You're getting into somewhat advanced AutoCAD programming topics, way ahead &lt;BR /&gt;
of your experience level. My advice would be to focus on more basic &lt;BR /&gt;
programming tasks to become more familar with not only the AutoCAD API, but &lt;BR /&gt;
the programming tools you're using, and more specifically, how events and &lt;BR /&gt;
event handlers work.&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message &lt;BR /&gt;
news:6169145@discussion.autodesk.com...&lt;BR /&gt;
No, no, no....That's way too easy. Thanks Tony. Any idea why the &lt;BR /&gt;
ObjectModified event gets fired twice for each object that is modified? Why &lt;BR /&gt;
would the DocumentManager_DocumentActivated event get called twice when I &lt;BR /&gt;
switch from one open drawing to another?&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Fri, 24 Apr 2009 06:40:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473373#M70919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-24T06:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473374#M70920</link>
      <description>I have so far managed to create an app that:&lt;BR /&gt;
1. Reads the block data from a given drawing, &lt;BR /&gt;
2. Then queries and returns the attribute data in a set of Oracle tables that are associated with the same drawing number. &lt;BR /&gt;
3. Combines the two sets of data together into a DataGridView and checks for consistency between them &lt;BR /&gt;
4. Then parses those grid entries out into 3 other DataGridViews depending on what state each entry is in.&lt;BR /&gt;
&lt;BR /&gt;
I need to be able to update the DataGridView data (and eventually the Oracle tables) as it is being modified by the user.&lt;BR /&gt;
The only way I see to do that is with event handlers.&lt;BR /&gt;
&lt;BR /&gt;
Perhaps if the AutoCAD documentation didn't suck so much I could parse my way through it.&lt;BR /&gt;
&lt;BR /&gt;
If I can't make this data update in real-time then this whole effort is worthless and I might as well leave it in VBA.</description>
      <pubDate>Fri, 24 Apr 2009 21:16:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473374#M70920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-24T21:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473375#M70921</link>
      <description>{quote}&lt;BR /&gt;
&lt;BR /&gt;
I need to be able to update the DataGridView data (and eventually the Oracle&lt;BR /&gt;
tables) as it is being modified by the user. The only way I see to do that&lt;BR /&gt;
is with event handlers. Perhaps if the AutoCAD documentation didn't suck so&lt;BR /&gt;
much I could parse my way through it. If I can't make this data update in&lt;BR /&gt;
real-time then this whole effort is worthless and I might as well leave it&lt;BR /&gt;
in VBA.&lt;BR /&gt;
&lt;BR /&gt;
{quote}.&lt;BR /&gt;
&lt;BR /&gt;
What happens if/when the user uses the UNDO function to undo changes they've &lt;BR /&gt;
made?  Go back to the database and change it again?  And, why does the data&lt;BR /&gt;
need to be updated in 'real-time' rather than at the point when the drawing&lt;BR /&gt;
file is saved?&lt;BR /&gt;
&lt;BR /&gt;
I generally do not advise that one try to keep data synchronized between an&lt;BR /&gt;
open DWG and an external data source, because there are numerous issues&lt;BR /&gt;
related to doing that, some of which you may not have considered. I don't&lt;BR /&gt;
think any documentation no matter how good it is, is going to explain all of&lt;BR /&gt;
that.&lt;BR /&gt;
&lt;BR /&gt;
Also, the problem you had isn't something you can blame on Autodesk's&lt;BR /&gt;
documentation.  Knowing that adding the same handler to the same event&lt;BR /&gt;
multiple causes the event to fire as many times, is .NET programming 101.&lt;BR /&gt;
&lt;BR /&gt;
As far as adding the ObjectModified event handler in the DocumentActivated&lt;BR /&gt;
event, I don't think it's unreasonable for someone to understand that the&lt;BR /&gt;
event fires many times, not just once, and you shoudn't need docs to &lt;BR /&gt;
understand that.&lt;BR /&gt;
&lt;BR /&gt;
You can add the ObjectModified event handler from within a handler of the&lt;BR /&gt;
DocumentCollection's DocumentAdded event, which only fires once for each &lt;BR /&gt;
DWG, when it is opened.&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message&lt;BR /&gt;
news:6170262@discussion.autodesk.com...&lt;BR /&gt;
I have so far managed to create an app that: 1. Reads the block data from a&lt;BR /&gt;
given drawing, 2. Then queries and returns the attribute data in a set of&lt;BR /&gt;
Oracle tables that are associated with the same drawing number. 3. Combines&lt;BR /&gt;
the two sets of data together into a DataGridView and checks for consistency&lt;BR /&gt;
between them 4. Then parses those grid entries out into 3 other&lt;BR /&gt;
DataGridViews depending on what state each entry is in. I need to be able to&lt;BR /&gt;
update the DataGridView data (and eventually the Oracle tables) as it is&lt;BR /&gt;
being modified by the user. The only way I see to do that is with event&lt;BR /&gt;
handlers. Perhaps if the AutoCAD documentation didn't suck so much I could&lt;BR /&gt;
parse my way through it. If I can't make this data update in real-time then&lt;BR /&gt;
this whole effort is worthless and I might as well leave it in VBA.&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Sat, 25 Apr 2009 03:26:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473375#M70921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-25T03:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473376#M70922</link>
      <description>In the VBA version of this program, I watch for the EATTEDT command and when it completes I execute a Sub that writes the new data into the database.  I am only doing this for Device blocks that are placed on a specific layer and that have a specific set of attributes.  Everything else is ignored.  The only reason I am not updating the display grids along with the database is that the VBA app won't run in tandem with AutoCAD. So everytime the user opens the Device Data dialog I run a synch Sub that queries the database,  refreshes the data and updates the display grid.  This has worked fine for the past year. All I want to do now is have the Device Data grid open all the time for reference and update it's contents as needed.&lt;BR /&gt;
&lt;BR /&gt;
As for Undo/Redo/Copy - don't really care because the next time a Device Data dialog is opened the synch takes place and those Devices are flagged as errors/duplicates until another EATTEDIT updates them again.&lt;BR /&gt;
&lt;BR /&gt;
As for documentation -  where is it written that the "DocumentCollection's DocumentAdded event only fires once for each DWG, when it is opened."&lt;BR /&gt;
&lt;BR /&gt;
Seems odd that I can do all these complex functions in VBA, but can't replicate them in C#.</description>
      <pubDate>Mon, 27 Apr 2009 15:45:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473376#M70922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-27T15:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473377#M70923</link>
      <description>"As for documentation - where is it written that the "DocumentCollection's &lt;BR /&gt;
DocumentAdded event only fires once for each DWG, when it is opened." Seems &lt;BR /&gt;
odd that I can do all these complex functions in VBA, but can't replicate &lt;BR /&gt;
them in C#."&lt;BR /&gt;
&lt;BR /&gt;
Why would it need to explicitly say that, when it is implied?&lt;BR /&gt;
&lt;BR /&gt;
When you open a drawing file, the DocumentAdded event fires, signaling that &lt;BR /&gt;
another document has been added to the documents collection. Doesn't it just &lt;BR /&gt;
take a little common sense to realize that this event would not fire more &lt;BR /&gt;
than once for a given document?&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message &lt;BR /&gt;
news:6170953@discussion.autodesk.com...&lt;BR /&gt;
In the VBA version of this program, I watch for the EATTEDT command and when &lt;BR /&gt;
it completes I execute a Sub that writes the new data into the database. I &lt;BR /&gt;
am only doing this for Device blocks that are placed on a specific layer and &lt;BR /&gt;
that have a specific set of attributes. Everything else is ignored. The only &lt;BR /&gt;
reason I am not updating the display grids along with the database is that &lt;BR /&gt;
the VBA app won't run in tandem with AutoCAD. So everytime the user opens &lt;BR /&gt;
the Device Data dialog I run a synch Sub that queries the database, &lt;BR /&gt;
refreshes the data and updates the display grid. This has worked fine for &lt;BR /&gt;
the past year. All I want to do now is have the Device Data grid open all &lt;BR /&gt;
the time for reference and update it's contents as needed. As for &lt;BR /&gt;
Undo/Redo/Copy - don't really care because the next time a Device Data &lt;BR /&gt;
dialog is opened the synch takes place and those Devices are flagged as &lt;BR /&gt;
errors/duplicates until another EATTEDIT updates them again. As for &lt;BR /&gt;
documentation - where is it written that the "DocumentCollection's &lt;BR /&gt;
DocumentAdded event only fires once for each DWG, when it is opened." Seems &lt;BR /&gt;
odd that I can do all these complex functions in VBA, but can't replicate &lt;BR /&gt;
them in C#.&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Mon, 27 Apr 2009 15:53:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473377#M70923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-27T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473378#M70924</link>
      <description>{quote}&lt;BR /&gt;
&lt;BR /&gt;
 Seems odd that I can do all these complex functions in VBA, but can't &lt;BR /&gt;
replicate them in C#.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Anything you can do in VBA can be done in C# , provided you're familar with &lt;BR /&gt;
the language and API.&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message &lt;BR /&gt;
news:6170953@discussion.autodesk.com...&lt;BR /&gt;
In the VBA version of this program, I watch for the EATTEDT command and when &lt;BR /&gt;
it completes I execute a Sub that writes the new data into the database. I &lt;BR /&gt;
am only doing this for Device blocks that are placed on a specific layer and &lt;BR /&gt;
that have a specific set of attributes. Everything else is ignored. The only &lt;BR /&gt;
reason I am not updating the display grids along with the database is that &lt;BR /&gt;
the VBA app won't run in tandem with AutoCAD. So everytime the user opens &lt;BR /&gt;
the Device Data dialog I run a synch Sub that queries the database, &lt;BR /&gt;
refreshes the data and updates the display grid. This has worked fine for &lt;BR /&gt;
the past year. All I want to do now is have the Device Data grid open all &lt;BR /&gt;
the time for reference and update it's contents as needed. As for &lt;BR /&gt;
Undo/Redo/Copy - don't really care because the next time a Device Data &lt;BR /&gt;
dialog is opened the synch takes place and those Devices are flagged as &lt;BR /&gt;
errors/duplicates until another EATTEDIT updates them again. As for &lt;BR /&gt;
documentation - where is it written that the "DocumentCollection's &lt;BR /&gt;
DocumentAdded event only fires once for each DWG, when it is opened." Seems &lt;BR /&gt;
odd that I can do all these complex functions in VBA, but can't replicate &lt;BR /&gt;
them in C#.&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Mon, 27 Apr 2009 16:02:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473378#M70924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-27T16:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473379#M70925</link>
      <description>" When you open a drawing file, the DocumentAdded event fires, signaling that another document has been added to the documents collection. Doesn't it just take a little common sense to realize that this event would not fire more than once for a given document?"&lt;BR /&gt;
&lt;BR /&gt;
There is no DocumentAdded event.&lt;BR /&gt;
Perhaps you meant DocumentActivated?</description>
      <pubDate>Tue, 28 Apr 2009 18:02:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473379#M70925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-28T18:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectModified Event Handler</title>
      <link>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473380#M70926</link>
      <description>Sorry, no I meant DocumentCreated, not DocumentAdded, but come to mention&lt;BR /&gt;
it, if you made the investement in becoming reasonably familar with the API &lt;BR /&gt;
and&lt;BR /&gt;
specifically, the DocumentCollection class, you probably woudln't have had &lt;BR /&gt;
to ask this, and probably wouldn't be having the problems you're had.&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;BR /&gt;
&lt;LIAL.WILLIAMS&gt; wrote in message&lt;BR /&gt;
news:6172056@discussion.autodesk.com...&lt;BR /&gt;
" When you open a drawing file, the DocumentAdded event fires, signaling&lt;BR /&gt;
that another document has been added to the documents collection. Doesn't it&lt;BR /&gt;
just take a little common sense to realize that this event would not fire&lt;BR /&gt;
more than once for a given document?" There is no DocumentAdded event.&lt;BR /&gt;
Perhaps you meant DocumentActivated?&lt;/LIAL.WILLIAMS&gt;</description>
      <pubDate>Tue, 28 Apr 2009 19:53:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/objectmodified-event-handler/m-p/2473380#M70926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-28T19:53:41Z</dc:date>
    </item>
  </channel>
</rss>

