[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Use the Power of the Command Line
Tip# 4118 By Russell Koenig On 20-May-2013
4.5
Rated By 2 users
Categories : Menus
Software type : AutoCAD 2014
Rename File To : No Files to download.
The Command line is the most powerful user interface tool in AutoCAD and AutoCAD verticals.

Russell Koenig reminds us of the power of the Command line in AutoCAD.

“Most CAD users keep one hand on the mouse all the time, and may keep the other near the keyboard to occasionally execute a command or press the Escape key. But virtually every AutoCAD command can also be performed by typing in the Command line. For example, to draw a closed 10' x 10' polyline through a series of x,y coordinates, you would manually type:

     PLINE<enter>0,0<enter>0,10<enter>10,10<enter>10,0<enter>CLOSE<enter>

pressing the Enter key where indicated.

“A benefit of this is that, if you have a command with a lot of follow-up text, or if you have a series of commands to run, you can enter all necessary text in a basic text program, copy it, and paste it into the Command line. In some cases, a space is also treated as a Return/Enter command. To create the same polyline shown above, copy and paste the following text into the Command line, and watch the lines appear (make sure your view is near coordinate 0,0):

     PLINE 0,0 0,10 10,10 10,0 CLOSE

“Notice that there are no spaces after the commas, but there are spaces separating the coordinate pairs and the commands. There is also a final space after Close to execute that closing command.

“Some commands also allow you to enter various settings as you go through them if you enter a hyphen at the beginning. For example, if you just enter Layer in the Command line, the layer manager will appear. But if you enter -Layer, you will receive another series of prompts that can also be answered in the Command line in the same manner. These next six lines of text (between the <> lines) when copied all together and pasted into the Command line will create a new layer called 'this is a new layer' with a cyan color and a dashed linetype. Note that some commands allow you to use a space to act as a Return/Enter command (like after -Layer), but sometimes you actually need to have a Return/Enter because a space is an allowable entry (such as in a layer name) which appears below as a new line. Sometimes you need multiple returns, which appear below as a blank line.

     <>

     -LAYER M this is a new layer

     C cyan

     L dashed
     < >

“You may need to test the various uses of this, but if you have a lot of repeated processes, this will save lots of time. As a surveyor, most of my commands are coordinate-based, and I use spreadsheets and various macro processes to create the pasteable commands from a list of survey point coordinates. Some of my more common uses of this procedure are to draw polylines, edit a series of blocks, draw circles at specific coordinates, set up layouts, and convert CAD standards."

Notes from Cadalyst tip reviewer Brian Benton: The Command line is the most powerful user interface tool in AutoCAD and AutoCAD verticals. You can do everything in AutoCAD through it. You can’t say that about any other interface tool in AutoCAD. AutoCAD 2014 has also increased the Command line’s abilities. You can search for blocks through it, search the Internet, find blocks, search system variables, click commands inside it, and more.

 

 

Average Rating:
4.5


User comments
Comment by Kurent,Michael
Posted on 2013-05-20 13:27:44
Been using AutoCAD since 2.6, so I ALWAYS use the command line. I turn off the ribbon and most of the point & click menus because they take up too much screen real estate and I'm faster/more productive with one hand on the keyboard and the other on the mouse. I also have been a huge fan/user of scripting with AutoCAD, so understanding the command line/scripting has saved me SO much time when I need to make the same change to multiple drawings.
Comment by Kirn,Michael
Posted on 2013-05-20 14:12:32
I agree with Michael Kurent, although I've only been using AutoCAD since v12. Keep one hand on the keyboard, one on the mouse (or puck if you're still lucky enough to use a digitizer). Use the hand on the keyboard to execute your commands (master the 1 and 2-key commands), and even make your lisp routines so they only use keys on the left side of the keyboard (for right-hand mousers). You'll save lots of time in the end. Also, you need to know the key-in commands and what the command line prompts are for any sort of batch scripting, which can be VERY powerful if executed properly.
Comment by Tulis,Ralph
Posted on 2013-05-20 22:20:18
I've been using AutoCAD almost since its inception. I agree with both Michael & Kim - left hand on the keyboard, thumb always on the space bar, and right hand on the mouse. Further, all of my most-used commands are abbreviated to one or two keystrokes. Combined with right-click or down-arrow for subcommands and you'll beat anyone working with the Ribbon.