Bug Watch January 20041 Jan, 2004 By: Steve Johnson
Color conundrum (2004 SP1)
Submitted by Laurent Campedel via Patrick Emin.
You can assign any color to layer 0, just as with any other layer. But if you choose anything other than the first 7 AutoCAD colors, something strange happens. Objects drawn on layer 0 with color Bylayer display as a slightly different color than objects drawn with the same AutoCAD color. For example, set layer 0 to use color 11 and create another layer called Eleven that uses color 11. Draw a filled object (for example, a wide polyline) on layer 0 with color Bylayer. Copy it twice so there are three identical objects that slightly overlap each other. Change the second object to use layer Eleven, and the third object to use color 11. The second and third objects display in the correct color (an unpleasant washed-out pink), but the first object continues to display in a different color (an even less pleasant, but darker, salmon pink). This affects only the display. Plotting is not affected.
No known workaround.
Underhanded Undo (2004 SP1)
In September 2003's Bug Watch, I asked for any problems you've experienced with the Undo command in AutoCAD 2004. I received quite a number of responses, and many reports also appear in Autodesk's discussion groups. Thanks to all those who provided information, and I'm sorry I can't respond to you all individually. The problems generally fall into one of two categories:
- AutoCAD refuses to undo more than one step, or in some cases goes back a handful of steps and no further. This is not caused by AutoCAD being configured to remember only a single undo step (Undo Control One). Some people noted that when this happens, it also clears the Previous selection set.
- AutoCAD performs a random number of undo steps, even when no undo has been requested. In many cases, this occurs when saving the drawing. In some cases, AutoCAD will undo right back to the beginning of the drawing session.
It's worth mentioning that many people, myself included, use AutoCAD 2004 regularly without ever seeing a problem with the Undo command. Because of that, and because these problems occur in a seemingly random fashion, it's difficult to work out exactly what is happening. However, it's possible to take an educated guess.
AutoCAD 2004 significantly overhauled the Undo mechanism to provide the multiple Redo facility. The easy answer is that this new code contains bugs that are causing the problems described above, but I suspect things are more complex than that. At least one known Undo problem is triggered by seemingly unrelated ObjectARX code. The code that triggers the problem could be in third-party applications, in Autodesk vertical applications (that is, the various Desktops), in the Express tools, or possibly even in AutoCAD itself. For the highly technical among you, Undo and Redo stop working if a commandEnded() reactor is triggered and calls acedSSGet(). Officially, aced* functions aren't designed for use inside reactors, but they have worked fine on all AutoCAD releases from 14 to 2002. The upshot is that even if AutoCAD 2004 is technically not guilty of causing the problem, it still breaks existing code and causes innocent users some nasty problems.
Accidental attribute appearance (2002 to 2004 SP1)
This one sounds a little complicated, but once you follow the steps a few times, it's not too tricky. If you want to avoid the detail, the executive summary is that reloading xrefs that contain nested blocks can cause attributes to appear that shouldn't be there.
Let's say you have a drawing that contains a block definition called Elmo, and that block contains attributes. All of the objects in Elmo are on layer 0. Insert Elmo on layer X. Create another block called Zoe and include Elmo in the block definition. Insert Zoe on layer Y. Save this drawing as Monsters. Start a new drawing and Xref Attach Monsters in the Model tab. Switch to a Layout tab and switch to model space. Zoom so that you can see the Monsters xref. Now freeze the Monsters X layer in the current viewport. As expected, Elmo vanishes after a Regen. Now for the bug. Xref Reload the Monsters xref. Elmo's attributes appear!
Workaround: If you can use a global freeze instead of a viewport freeze, that avoids the problem. If you can't, you need to close and open the parent drawing instead of using Xref Reload.
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!