TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: matthewj on October 05, 2009, 08:41:42 PM
-
First off, this site's been a huge help over the past week. So thanks for just being here.
This is my first post, and I haven't been able to find information on my current dilemma. Heres hoping that people smarter than I am might help out.
The problem: I'm writing a routine that temporarily changes the crosshair color (part of a modal layer utility) & saves the user's original color to the blackboard namespace. If the alternate color is active when Autocad exits (or crashes) the crosshair color stays the alternate color. Right now I'm working around this by setting the crosshair color back to white(model)/black(layout) (& only if needed) at lisp load. This is all fine and good, but it's pretty crappy for users who have custom crosshair colors & those that have embraced the v2010 off-white model-space background.
I was hoping that there might be an "execute on autocad exit" functionality in AutoLisp. (Though this solution wouldn't help much if Autocad crashed.)
Is there another way to do this? I'd like to not save any preference files to the user's computer if at all possible, but perhaps that's the way to go. (I can post the routine if you want, just figured I'd keep the s/n ratio down.)
Thanks for your time,
Matt.
-
A vlr-command-reactor can issue if the command matches a defined list.
-
Welcome to the Swamp.
Check these out.
Close DWG Reactors
http://www.theswamp.org/index.php?topic=12986.msg157991#msg157991
http://www.theswamp.org/index.php?topic=12986.msg158077#msg158077
http://www.theswamp.org/index.php?topic=26752.msg322500#msg322500
-
...Oh that is just too rad.
Thanks, got it working properly. Unfortunately, now that I've started to explore reactors, my feature list for this utility just got longer. :-D
I'll post the finished lisp in a few days.
Thanks again,
Matt
-
Why would you not reload the users profile to restore his/her preferences?
-
You mean reload them through the script? I hadn't thought of that.
Though I'm not sure how that would work if the users' are using an unnamed profile... I guess there's probably a way to save a temporary profile and restore that later on through a script. Though, I have to say, I'm very pleased with how its turned out so far.
Unfortunately, not everybody uses profiles. I'll admit that sometimes I fiddle with my stuff and don't always update any of my profiles until (sometimes weeks!) later. Dumb, I know.
-
An Un-named Profile would be no help.
I suppose your own registry save would be the way to go.
-
You can set the "<< Unnamed Profile >>" as current profile.