With that, I can simply through the command. I will of course enter C-ROAD-TEXT at this point.Įnter name list of layer(s) for color 2 (yellow) : C-ROAD-TEXT Building a Script from a Command SequenceĪt this point, I have now assigned the color Yellow to my newly created C-ROAD-TEXT layer. As some may know, for primary colors such as Red, Yellow, Blue, even Cyan, I can either enter the colors number or it’s name.Īfter specifying my desired color, I must now tell AutoCAD which layer to make yellow. To do that I’ll enter C, which we now know stands for Color.Īssuming I use one of the standard 255 AutoCAD colors, I can simply enter the desired number. Upon pressing enter I am returned to the base LAYER command, where I can now change the color of my C-ROAD-TEXT layer from the default, White, to Yellow. In this case, I’m going to enter C-ROAD-TEXT.Įnter name list for new layer(s): C-ROAD-TEXT The option to create a new layer is New, and so I’ll simply enter N at the command line.Īfter specifying the New option, AutoCAD will now prompt me with the following where I will enter my desired layer name. Looking once again at the command prompt, I want to create a layer named C-ROAD-TEXT.
Thus rather than typing C, you could type Color in its entirety. Using these abbreviations will share you a few keystrokes, but when in doubt you can always spell out the entire option. In looking at the command prompt, you’ll notice that Color is represented with just the C capitalized, whereas MATerial has MAT capitalized. Looking at the -LAYER command, typing “C” will allow you to set a color, but assigning a material means three characters MAT. The important thing to pay attention to here is which letter(s) are capitalized. Typing -LAYER at the command line results in the following prompt:Įnter an option [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/UnlockĪdmittedly, navigating the command line version of a command can certainly add a degree of intimidation to this whole process. Using the Command Line Version of a Command This will suppress the dialog, and present the entire command at the command line. Consequently, rather than typing LAYER which opens the Layer Manager Dialog, we will need to type -LAYER. Generally, this can be done by prefixing the command name with a hyphen (-). For this reason, we must explicitly tell AutoCAD to use the command line version of a command. While this is great for general usage, script files have no way to interact with dialog boxes. By default, AutoCAD uses the dialog box version of a command. The LAYER command is among a growing number of AutoCAD Commands which have both a dialog box version and a command line version. Let’s take a look at how we might create a script file which creates a new layer named C-ROAD-TEXT, sets its color to Yellow, and then sets the layer current.
Thus if you know how to type commands at the command line, you know how to write a script file.
So how is that possible? Well, an AutoCAD script file is really nothing more than a sequence of standard AutoCAD Commands. While I know the sheer term “Script File” intimidates many, but truth be known, you’ve been writing script files for as long as you have been using AutoCAD. Luckily script customization affords even rookie AutoCAD users a way to automate AutoCAD with endless possibility.
NET customization can be rather illusive for all but a small minority of the AutoCAD user base.
Each of these features is included in the software for one reason – user customization. Be it the CUI command, LISP routines, or even VBA and. In fact some would argue the malleability of the software as being its best feature. Although each release of AutoCAD translates to bigger and arguably better features one thing has never changed its malleability.