TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: BlackBox on June 05, 2012, 12:30:23 PM
-
Silly question, but which reactor type (and event) is used to fire a callback when a Preferences Object is modified?
I'm attempting to programmatically determine when the Preferences Object (or a property of) has been changed, without catching all Options Command invocations, and monitoring each LispWillStart events, as either may make changes.
-
Since many of the properties of the Preferences Object are stored by Env Vars in the Registry or Sys Vars, you would need a way to monitor the values of such variables (vlr-sysvar-reactor immediately springs to mind for the System Variables), not sure how you would monitor the registry however.
-
Thanks for the response, Lee.
Unfortunately, there is no System Variable for the property I am attempting to monitor.
Frankly, I am shocked that there's no direct way of monitoring Visual LISP Objects (in general). :-o
I really wanted to do this project in LISP (put in a fair amount of my personal time), but it looks as though I may have to start over with .NET :| ... Good practice I guess. LoL
-
What specifically are you wanting to track?
-
What specifically are you wanting to track?
Any of the Preference Property Objects, i.e., Display, Drafting, Files, Profiles, Selection, etc.
Specifically, any Preferences Property Object properties that do not have System Variables assigned.
-
Actually I'm unaware of something to monitor those even in ObjectARX, so I'm guessing the same applies for Acad's DotNet libraries.
You might have to monitor the registry keys themselves. I know you get programs which can do this, so it must be possible. Actually, here's a sample C#
http://stackoverflow.com/questions/826971/registry-watcher-c-sharp (http://stackoverflow.com/questions/826971/registry-watcher-c-sharp)
-
Thanks Irneb, WqlEventQuery sounds like what I'm after.
... Started [re-]coding the application in C# last night, I only finished the CommandMethod user prompt, and conditional structure (based upon the user's PromptResult). Next, I need to code some app-specific registry classes, so this seems to fit right in with the application structure I'm envisioning. :-D
Cheers!
** Edit - Oh, now I 'spose that I need to find the registry keys to monitor, too. lmao
-
A suggestion for the Visual LISP route: how about using a Command Reactor with a call-back function triggered on the :vlr-commandwillstart event to record the necessary registry keys when the 'Options' command is used; then, another call-back function triggered on the :vlr-commandended event that will check those same keys against the cached values to detect any changes.
Just an idea | Untested.
-
That's also a nice idea Lee! Though it's still going to make RM's day searching for all the envars and/or registry keys :lmao:
-
A suggestion for the Visual LISP route: how about using a Command Reactor with a call-back function triggered on the :vlr-commandwillstart event to record the necessary registry keys when the 'Options' command is used; then, another call-back function triggered on the :vlr-commandended event that will check those same keys against the cached values to detect any changes.
Just an idea | Untested.
That is almost the exact methodology that I have been using prior to posting this thread.
The problem being, as I see it, that it's inefficient in that it monitors all instances of the user issuing the OPTIONS command, _and_ either has to monitor all LispWillStart events, or knowingly leave open a back door (by not doing so), as LISP can also change these Properties.
That can be done, but it seems like overkill for what I see as such a small, yet intuitive task.
That's also a nice idea Lee! Though it's still going to make RM's day searching for all the envars and/or registry keys :lmao:
Actually, if I go with the pure Reactor route, it's easier to programmatically Set the appropriate values upon *WillStart events, than teaching myself how to _properly_ use Delegates, and Event Monitors. LoL It's just unnecessary burden on the end-user's processing time. LoL
I appreciate everyone's assistance!
-
All that and more . . ..
Yea, you will have to hard code the specific registry entrees your interested in.
good luck - sorry I couldn't have been more help . . ..
-
No worries; cheers!