I recently received a question from a customer in Germany asking if there was any way, from the AutoCAD command line, to remove layer overrides from viewports (per-viewport layer overrides is a feature we introduced in AutoCAD 2008 that allows you to apply layer property overrides for color, linetype, lineweight and plot style, and make objects on a layer display differently in different viewports without affecting the global layer properties). Typically, you remove viewport overrides using the Layer dialog or the right-click context menu on a viewport object, however this customer needed a way to automate the process a bit more and drive it from the command line. As it happens, there is an undocumented way to do this.
The VPLAYER command includes the hidden keyword option reMoveoverrides. You won't see this keyword in the list of options but if you enter M at the initial VPLAYER prompt, you'll get a sub-prompt of options to remove one or all types of layer property overrides. You can choose which layers these overrides should be removed from and in which viewports.
In this example, I'm removing all the viewport overrides from all the layers in the current viewport:
In this example, I'm removing only the color override from only Layer1 in all the viewports:
VPLAYEROVERRIDESMODE
Of course, if you don't need to remove viewport overrides and just want to temporarily disable them, you can always use the VPLAYEROVERRRIDESMODE system variable. This is a quick way to globally turn layer overrides on and off in the current drawing.
Setting VPLAYEROVERRIDESMODE to 0 causes all layers in all viewports to display using their global properties. This is how everything would look if no viewport overrides were applied. The overrides are still in place, they just aren't displaying.
Setting VPLAYEROVERRIDESMODE to 1 causes all layers in all viewports to display using any assigned layer property overrides.
Note: Property overrides can still be assigned even when VPLAYEROVERRIDESMODE is set to 0. Also, all visual indications that a layer has overrides will still display even when VPLAYEROVERRIDESMODE is set to 0. This includes background colors and the Viewport Overrides layer filter in the Layer dialog.
Taking a Break
Well, that's likely my last post for the year. Autodesk employees are taking a couple of company furlough days and then shutting down for our annual week of rest. With the exception of staff dedicated to manning our critical systems, it will be a bit quiet from the Autodesk camp for the next two weeks.
On behalf of Dan Scales and myself, thank you for your questions, comments, and faithful reading of Without A Net. We'll be back again next year.
P.S., I don't know about you, but I enjoy this time of year because I can sound like a complete procrastinator: "Never mind, I'll do that next year."
Nice article.....I very much crazy about this......We are waiting your next article....
Posted by: fallen earth chips | January 08, 2010 at 01:06 AM