Bug Watch: Losing your AutoCAD 2006 settings? Here's why.15 Dec, 2005 By: Steve Johnson Cadalyst
How AutoCAD 2006 can mess up your settings, and an activation problem with a workaround.
Overriding Your Settings (2006 to 2006 SP1)
Owen Wengard reported this bug. AutoCAD 2006 introduced a highly useful practical drafting feature, Temporary Overrides, which allows you to hold down a key or combination of keys to temporarily override your current settings. For example, you might have an end point running object snap set. In a command, you're being prompted for a point, and you want to pick a midpoint. Instead of using the midpoint object snap, you can hold down Shift+M, pick your point, and then release Shift+M. Just holding down Shift temporarily toggles your Ortho setting. Better still, you can define your own Temporary Overrides, although you have to brave the CUI system to do so.
So what's the problem? It can mess up your settings. I'll need to explain a little about how LISP, Visual Basic, ARX and other programs save and restore your settings. It is quite common for programs to need to change various AutoCAD system variables, and a well-behaved program should always put things back how it found them. The following program remembers the Osmode setting, sets it to 0, lets the user pick a point and then puts Osmode back how it found it. There are more sophisticated ways of doing this, but this simple example will do.
(defun C:TOTEST (/ osmode) (setq osmode (getvar "OSMODE")) (setvar "OSMODE" 0) (getpoint "\nPick a point: ") (setvar "OSMODE" osmode) (princ) )In previous releases of AutoCAD, this code ensured that the routine left things as they were at the start of the command, unless the user cancelled the command. You even can use an error handler to allow for that eventuality. Not in AutoCAD 2006. To prove this, set an end point running object snap and start the Totest command defined above. When prompted for a point, hold down Shift+M and pick a point. Now check your running object snap. You expect it to be set back to end point like it was at the start of the command. But, it's not, it's turned off!
This doesn't just affect object snaps, and it doesn't just affect the settings related to the Temporary Override you use. It affects all sorts of settings. I've seen many reports from AutoCAD 2006 users of various settings mysteriously changing themselves, and I suspect Temporary Overrides are the culprit in many of these cases.
This problem occurs because the Temporary Override is trying to do the right thing. When the key combination is released, it restores the settings to what they were when it was first pressed. The trouble is, this methodology fails when the key is released after a command is finished, because the settings being restored are the wrong ones. Autodesk needs to think of a more sophisticated approach before this feature is fully baked.
Workaround: If you're just a user of LISP and other programs, there's not much you can do other than avoid the use of Temporary Overrides altogether. If you don't want to do that, I suggest you make a menu item that sets a whole bunch of system variables to your preferred settings, so you can quickly put things back to normal.
If you're a programmer, examine your code to see if you can allow for this situation. Only change system variables for that portion of the program where you really need to do so, and try to avoid the variables being in a modified state at the time the user is being prompted for input.
Inactivation (2006 to 2006 SP1)
On some systems, when attempting to activate (authorize) your AutoCAD, it fails with this message:
There are two problems here. One is that AutoCAD has failed to establish a connection to Autodesk. The second is that it activates a bug in the script when that happens.
Workaround: The first problem is open to conjecture. Autodesk would like to assume the problem is at your end, but it appears only AutoCAD 2006 has a problem with some firewall settings and proxy server arrangements. AutoCAD 2005 activates fine on the same systems, which makes me suspicious, but I'll keep an open mind until I've tracked things down a little further. You may wish to examine the thread mentioned below for some possible workarounds to the connection issue.
The second problem is just a plain old bug, and is easily fixed with the right file. Have a look at this thread in the AutoCAD discussion groups, and download the file RTSUNSUBMIT.ZIP. Copy the RTSUNSUBMIT.HTML file from that ZIP file into the WebDepot folder under your AutoCAD 2006 program folder. If you are using Deployment Wizard to set up your AutoCAD installations, you will also need to copy it into the Program Files\Root\WebDepot folder on your installation server. When you try again, it may be very slow and go through several steps which appear to end in failure. Don't give up! One more attempt should do it.
About the Author: Steve Johnson
Autodesk Technical Evangelist Lynn Allen guides you through a different AutoCAD feature in every edition of her popular "Circles and Lines" tutorial series. For even more AutoCAD how-to, check out Lynn's quick tips in the Cadalyst Video Gallery. Subscribe to Cadalyst's free Tips & Tools Weekly e-newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!