8 minute read

AutoCad

LayerApps: Filling in the Gaps

AUTOCAD LAYER COMMAND

In the early 80’s when AutoCAD was first introduced, it had already built into its engine the very useful Layer command. Though at first it was just invoked from the command line, by 1987 AutoCAD Release 9 introduced for the first time a dialog box user interface for Layer manipulation with the DDLmodes command (see Figure 1).

Since then, AutoCAD has continued to develop and enhance the Layer command user interface to the current Windows based Layer palette. The Layer palette is now filled with many more selections, scroll bars and a resizable window that can float on the screen while drawing modification continues (see Figure 2).

AutoCAD has also through the years provided many additional tools to assist with Layer manipulations. But since there is always room for improvement users like me decided to develop a few additional commands to fill in the gaps. A few years back I grouped these AutoLISP/Visual LISP and DCL coded commands into a single app I call LayerApps and shared it for free on the Autodesk App Store: LayerApps | AutoCAD | Autodesk App Store

Figure 1 Figure 2

INTRODUCING LayerApps

LayerApps is made up of 5 separate added commands to assist in controlling Layers within AutoCAD. Since each of these commands presents a dialog box interface to facilitate with Layer manipulations, I’ve named the commands prefixed Figure 3 with “DD” to mimic AutoCAD commands using the Dynamic Dialog Box interface first introduced back in 1992 on AutoCAD Release 12. After successfully installing LayerApps and AutoCAD is launched, there is a new LayerApps panel added under the Add-Ins menu in the Ribbon. In addition, there is a new LayerApps Toolbar that can be either docked or left floating on the graphics screen for quick command selection (see Figure 4).

Figure 4

DDLyrAdd

The first LayerApps added command is called DDLyrAdd. This command can be accessed by selecting from the LayerApps Add-Ins drop down or Toolbar the button with the three + symbols. The DDLyrAdd command offers the option to add to all the Layer names in the current drawing a Prefix, Suffix or Both. For example, there are times when I would receive drawings from other Architects to work on for either a remodel or addition and the Layer names would be missing the prefix which Layer naming standards like the AIA would call a discipline designator. So now using the DDLyrAdd command I can use a dialog user interface to add the Prefix to some or all Layers that are selected to be given a discipline designator like A- for Architects or S- for Structures etc. (see Figure 6).

Figure 5 Figure 6

DDLyrCas

The second LayerApps added command is called DDLyrCas. This command can be accessed by selecting from the LayerApps Add-Ins drop down or Toolbar the button showing the three letters CAS. Figure 7 The DDLyrCas command offers the user the feature to change the letter case of the Layer names. I usually use this command when I get confused by looking at a mixture of uppercase and lowercase Layer names on the Layer palette. Now with all the Layer names listed alphabetically in a dialog user interface I can

Figure 8

select some or all the Layer names to be Capitalized or Lowercased or just change the first letter in the name to Uppercase like in a sentence (see Figure 8).

DDLyrOn

The third LayerApps added command is called DDLyrOn. This command can be accessed by selecting from the LayerApps Add-Ins drop down or Toolbar the button with the three black light bulbs. The DDLyrOn command is extremely useful because although AutoCAD provides an excellent command to select objects to turn Off the Layer, there isn’t a graphic user interface to select those Layers to turn back On. Now with the DDLyrOn command all Layers turned Off are presented in a window for selection to be turned back On. Furthermore, if a Layer is also Frozen, the user is given the option to have those layers Thawed. Lastly, there’s an option to sort the listing by Layer name in alphabetical order or based on the Layer Frozen/Thaw Status (see Figure 10).

Figure 9 Figure 10

DDLyrTh

The fourth LayerApps added command is called DDLyrTh. This command can be accessed by selecting from the LayerApps Add-Ins drop down or Toolbar the button with the three white snowflakes. The Figure 11 DDLyrTh command is similar to the DDLyrOn command. DDLyrTh offers to the user all Layers that have been Frozen and presents them in a window for selection to Thaw. If a Layer that’s Frozen is also turned Off,

Figure 12 the user is given the option to have those Layers turned On (see Figure 12).

In addition, if the current Paperspace Viewport has Viewport Frozen Layers, DDLyrTh will also present on a second listing side by side next to the Frozen Layer listing for the user to select Layers to be VPLayer Thawed (see Figure 13).

Lastly, like the DDLyrOn command the DDLyrTh command offers sorting options by Layer name or by Layer Off/On status.

DDLyrVpc

The fifth LayerApps added command is called DDLyrVpc. This command can be accessed by selecting from the LayerApps Add-Ins drop down or Toolbar the button with the three colored squares. Figure 14 The DDLyrVpc command adds a much needed legible 255 Color assignment selection to Layers. I have always thought that AutoCAD’s Color selection window is just way too small to see (see Figure 15). Prior to AutoCAD 2000 when AutoCAD relied on the DCL files (Acad.dcl & Base.dcl) to present the Color selection window I was able to edit and customize those files to enlarge the window and even reposition the color swatches to match our office color pen weight standards. But since AutoCAD added support for millions of colors including Color books selections, in addition to dropping the use of the DCL files to present the Color window it has also chosen to continue to present the small Color selection window. I decided to code DDLyrVpc to give myself a large easier to see set of Color swatches for Layer assignment selection. The window automatically expands in width to accommodate Layer name listing up to 120 characters in length. The Layer name listing can show All, No Xrefs or only Xref Layer names. The Listing can be sorted by Layer Name, Color or VP Color if run from Paperspace. I also included the option to remove Xref or Viewport Layer Color assignment overrides. If there are Layer Color

Figure 15

overrides, these are shown in the Layer listing preceded by a dash “-“ in front of the Color number (see Figure 16).

IN CONCLUSION

Though Autodesk has accomplished the amazing task of developing AutoCAD for the past 4 decades to the feature rich product offered to customers today, it still acknowledges there are areas where they have missed addressing the various user needs. This is why Autodesk has always offered various methods to their customers to customize and add to AutoCAD to fill up those gaps. I hope you’ll find my LayerApps tool an excellent addition to fill the gap as you continued your AutoCAD expeditions.

Mr. Paul Li graduated in 1988 from the University of Southern California with a Bachelor of Architecture degree. He worked in the Architectural field for small to midsize global firms for over 33 years. Throughout his tenure in Architecture, he has mastered the use and customization of AutoCAD. Using AutoLISP/ Visual Lisp combined with Dialog Control Language (DCL) programming he has developed a number of Apps that enhance the effectiveness of AutoCAD in his profession. All the Apps actually came out of meeting challenging needs that occurred while he worked in the various offices. He has made all the Apps available for free and can be downloaded from the Autodesk App Store. Though he recently retired from the Architectural profession, Paul continues to write articles depicting his past work experience. Some of these articles can be found in AUGIWorld Magazine where he shares his knowledge learned. Paul can be reached for comments or questions at PaulLi_apa@hotmail.com.

AUGI Members Reach Higher with Expanded Benefits

AUGI is introducing three new Membership levels that will bring you more benefits than ever before. Each level will bring you more content and expertise to share with fellow members, plus provide an expanded, more interactive website, publication access, and much more!

Basic members have access to: • Forums • HotNews (last 12 months) • AUGIWorld (last 12 months)

DUES: Free

Student members have access to: • Forums • HotNews (last 24 months) • AUGIWorld (last 24 months) • AUGI Educational Offerings

DUES: $2/month or $20/year

Professional members have access to: • Forums • HotNews (full access) • AUGIWorld (full access and in print) • AUGI Library • ADN Standard

Membership Offer

DUES: $5/month or $50/year

This article is from: