Author Topic: Database.ObjectModified Event  (Read 15069 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
Re: Database.ObjectModified Event
« Reply #15 on: December 12, 2012, 10:38:25 AM »
So I've been testing the EnteringQuiescentState approach, and while it works, it's still not 'instantaneous' when one manually makes changes via Properties Palette... There's a delay, until one hits Esc, or click, windows, etc..

I tried looking for alternative Events, and one that came to mind is when DocumentLockModeChangedEventArgs.CurrentMode == DocumentLockMode.NotLocked, but I suspect that there may be some issues with that.

First issue that comes to mind, is attempting to Lock the Document, as this would raise the DocumentLockModeChanged Event again... So I would need to set a bool Property or Field such that the leading if statement would first check for this before continuing... But that still leaves room for an eLockChangeInProgress Exception.

Does anyone have another suggestion(s), in order for me to manipulate the ObjectIds following Database.ObjectModified Event?
"How we think determines what we do, and what we do determines what we get."

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Database.ObjectModified Event
« Reply #16 on: December 12, 2012, 11:47:58 AM »
I have never done testing and just guessing that it would maybe be too resource heavy but could maybe use ObjectOverrule and handle with Close?

TheMaster

  • Guest
Re: Database.ObjectModified Event
« Reply #17 on: December 12, 2012, 09:07:34 PM »
So I've been testing the EnteringQuiescentState approach, and while it works, it's still not 'instantaneous' when one manually makes changes via Properties Palette... There's a delay, until one hits Esc, or click, windows, etc..

I tried looking for alternative Events, and one that came to mind is when DocumentLockModeChangedEventArgs.CurrentMode == DocumentLockMode.NotLocked, but I suspect that there may be some issues with that.

First issue that comes to mind, is attempting to Lock the Document, as this would raise the DocumentLockModeChanged Event again... So I would need to set a bool Property or Field such that the leading if statement would first check for this before continuing... But that still leaves room for an eLockChangeInProgress Exception.

Does anyone have another suggestion(s), in order for me to manipulate the ObjectIds following Database.ObjectModified Event?

Trying to carry the methods used in LISP or VBA over to .NET might work in some cases, but usually introduces its own set of problems, and still suffers from the same limitations you had in the previous implementation.

From the Close() override of an ObjectOverrule, you can modify the object.

If someone here has access to it, feel free to post a copy of my Overrule sample that shows exactly how that can be done (I'd post it myself but it'll take some time for me to find the original that has long since been modified for publication elsewhere).



BlackBox

  • King Gator
  • Posts: 3770
Re: Database.ObjectModified Event
« Reply #18 on: December 13, 2012, 09:14:41 AM »
Trying to carry the methods used in LISP or VBA over to .NET might work in some cases, but usually introduces its own set of problems, and still suffers from the same limitations you had in the previous implementation.

Perhaps poorly, that's actually what I am attempting to do here (leave behind my LISP mindset, and elevate my logic to that of .NET development)... Something as you can see I have not yet mastered.

From the Close() override of an ObjectOverrule, you can modify the object.

If someone here has access to it, feel free to post a copy of my Overrule sample that shows exactly how that can be done (I'd post it myself but it'll take some time for me to find the original that has long since been modified for publication elsewhere).

You are kind to offer continued guidance to, not just me, but the AutoCAD development community in general... Thank you, Tony.



In a quick search here for your OverruleSample.zip (previously available from your site here, according to this post). I even found where Kean lauded your comments here... I am however, still unable to find your Overrule Sampe to download and study, even with Wayback Machine... Perhaps I'll ask Jeff H for it:-)
"How we think determines what we do, and what we do determines what we get."

TheMaster

  • Guest
Re: Database.ObjectModified Event
« Reply #19 on: December 13, 2012, 11:43:05 PM »
Attached is one of the samples (I don't know if this was included in the copy I distributed), which shows how to lock the layer of all block references.
« Last Edit: December 13, 2012, 11:56:29 PM by TT »

BlackBox

  • King Gator
  • Posts: 3770
Re: Database.ObjectModified Event
« Reply #20 on: December 14, 2012, 10:12:53 AM »
Attached is one of the samples (I don't know if this was included in the copy I distributed), which shows how to lock the layer of all block references.

Thank you, Tony.
"How we think determines what we do, and what we do determines what we get."