AutoCAD

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:

Script Error

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.


AutoCAD Tips!

Lynn Allen

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 Tips & Tricks Tuesdays free e-newsletter and we'll notify you every time a new video tip is available. All exclusively from Cadalyst!
Follow Lynn on Twitter Follow Lynn on Twitter


Latest News from Cadalyst Partners
Feed
Place your DWG File on a Diet   18 Jun, 2013

I received an email from blog reader Steve Roberts with a suggested tip topic on how to reduce the size and clean up DWG drawing files using four...More>>Read all Between the Lines blog posts>>

Feed
Tech Toys 360: Pro-Form Le Tour de France Bike   18 Jun, 2013

The greatest bike race in the world is held June 19 to July 21 this year. Celebrating its 100th year, the Tour de France sends riders through more...More>>Read more PTC Creo blog posts>>

Feed
Update 3 now available for Revit 2013 Products - Revit Clinic   18 Jun, 2013

...More>>Read more BIMbuilder blog posts>>

Feed
Nice Design—What Does It Feel Like?   17 Jun, 2013

...More>>Read more SolidWorks Blog posts>>

Feed
LiveMap: The Augmented Reality Motorcycle Helmet of the Future?   18 Jun, 2013

Philippe Starck once famously said that there should be no cars on the road—-only motorcycles. While some soccer moms may disagree, his theory...More>>Read more SolidSmack blog posts>>

Poll
How many years' experience do you have using CAD software?
Less than two years
2–5 years
6–10 years
11–20 years
21+ years
Submit Vote




FREE Resources for CAD, BIM, and PLM Users





Subscribe Cadalyst Newsletters