Overview

This software makes drawing with Autocad an enjoyable task! It extends capabilities of Autocad resulting in significant time savings during the drawing process for designers and engineers of any discipline. Techniques to save keystrokes for Autocad’s most used editing commands are implemented.

 

The code supplied includes two-key commands (no enter required) that let any key on the keyboard be the the second key that executes a command. Also, you will be able to assign commands from within Autocad to function keys or number pad keys. Tutorials accompanied by illustrations will help you get a fast start.

 

Variables for dimscale ‘ds’, distance ‘d’, degrees ‘a’, precision ‘pc’, linetype factor ‘ltf’, color ‘col’, block name ‘bname’, and scale factor ‘sf’ are used to expedite commands. The user is introduced to a simple and effective process of drawing quickly and easily with layers named 0 through 9.

 

Finding dimensions of like dimstyles  and finding text of the same height  is made possible with ease and dramatic results on Autocad’s screen. You can pick text parameters from existing text, and get scale factors from two circles, two lines, two text entities, or two inserts. You can copy and paste text or attributes to text or attributes in an insert without a dialog box. You may also edit text or attributes without a dialog box (for small edits).

 

The code includes commands for exporting text, two clipboards, and simple math. Pasteblock is a command that pastes the clipboard contents as a block with a name provided by Autocad. We define the same command to insert the block and store the block’s name in a variable ‘bname’. This variable is used in other commands like the command reb to rename a block. Autocad’s block name can be renamed easily to a friendlier one because you do not have to type its name. The name appears as the default when you rename it with the command reb. Also, the command ii, used to insert blocks may be used. Again, the variable ‘bname’ is the default for inserting the block.

 

Autocad’s commands remain unchanged, except c:c the Circle command has been replaced by the command cr the new Circle command, and the command ta the Tablet command has been replaced by the command tab the new Tablet command. We have redefined Autocad’s copy command ‘c’ for circle to to the command c for copy, because while drawing, most of the time we copy many more times than do we draw circles.  Autocad’s command ta for tablet is redefined to the command ta to type text again to new parameters.

 

Drawing quickly and easily with layers named 0 through 9:  See: Basic Tutorial.

 

After the code is loaded the command c:mla creates layers 1 through 9, each with colors 1 through 9. c:12 is used to change entities to layer 1; c:23 changes entities to layer 2 and so on till c:0- changes entities to layer 0. This makes it easy to remember these commands. Type the layer number and the key next to it on the right to change entities’ layers.

 

Setting a layer current is done in a similar manner. c:21 sets the layer 1 current; c:32 sets the layer 2 current and so on till c:-0 sets layer 0 current. Also c:0 alone sets layer 0.

 

The following additional commands are used for creating a drawing:

 

c:7 Turns all layers on.

c:9 Turns all layers off (except current layer).

c:8 Used to set a layer current by picking an entity on that layer.

c:5 Erases entities in repeating crossing window selections.

c:- Used to turn a layer off by picking an entity on that layer.

c:= Keeps only layer of entity picked on and rest off.

c:2 Used to type in a layer name to a variable “lay” used in subsequent commands.

c:3 Used to change entities’ layer to the layer name stored in the variable “lay”.

c:-- Turns off layer name in variable “lay”.

c:== Keeps only layer in variable “lay” on, the rest off.

c:tl Changes entities’ layers one at a time to layer name in variable ‘lay’.

c:tll Copies an entity and changes it to layer name stored in “lay”.

c:ttl Copies entities and changes new entities to layer in “lay”.

 

Note:

c:3 works with repeating crossing windows. Use cancel to stop the command.

Initially the name in “lay” is set to “0”.

c:8 also sets layer variable “lay” to layer of entity picked. Using c:3 after c:8 changes entities to that layer.

Use Autocad’s undo command to undo after c:3 or c:5 with the sequence: Undo, enter, b (for back), enter.

 

Tutorial for Basic commands

 

Start Autocad and open Tutorial.dwg. This drawing contains one line on each of layers 0 through 9. The current layer is the layer named 4.

 

Setting Layers Current

Try the following commands to set a layer to be the current layer.

 

To set layer 1 current

To set layer 2 current

To set layer 3 current

To set layer 4 current

To set layer 5 current

Command: 21 + enter

Command: 32 + enter

Command: 43 + enter

Command: 54 + enter

Command: 65 + enter

 

To set layer 6 current

To set layer 7 current

To set layer 8 current

To set layer 9 current

To set layer 0 current

Command: 76 + enter

Command: 87 + enter

Command: 98 + enter

Command: 09 + enter

Command: -0 + enter

 

Changing entities’ layers

Use the following commands to change entities’ layers.

 

To change to layer 1

To change to layer 2

To change to layer 3

To change to layer 4

To change to layer 5

Command: 12 + enter

Command: 23 + enter

Command: 34 + enter

Command: 45 + enter

Command: 56 + enter

 

To change to layer 6

To change to layer 7

To change to layer 8

To change to layer 9

To change to layer 0

Command: 67 + enter

Command: 78 + enter

Command: 89 + enter

Command: 90 + enter

Command: 0- + enter

 

Now, try the following commands.

 

Turn all layers off except current layer

Command: 9 + enter

Every layer gets turned off.

Turn all layers on.

Command: 7 + enter

Every layer gets turned on.

Setting a layer current by picking an object

Command: 8 + enter

At the prompt pick on any object in the drawing to set its layer current.

Erase entities with repeating crossing window selections

Command: 5 + enter

Make crossing window selections to erase entities.

Turn a layer off by picking an entity on that layer

Command: - + enter

At the prompt pick on an object to turn its layer off.

Keep one layer on by picking an entity on that layer

Command: = + enter

At the prompt pick on an object to keep only its layer on. This sets that object’s layer current and turns other layers off.

Changing the layer name variable ‘lay’

Command: 2 + enter

At the prompt type in a new name for the variable ‘lay’ and press enter.

Change entities’ layer to the layer name stored in the variable “lay”

Command: 3 + enter

Select entities to change to the layer ‘lay’ with crossing window selections.

Turn the layer ‘lay’ off

Command: -- + enter

This turns the layer with the name that is stored in the layer name variable ‘lay’ off. No pick is required.

Keep only layer in variable “lay” on, the rest off

Command: == + enter

This turns the layer with the name that is stored in the layer name variable ‘lay’ off. No pick is required.

Change entities’ layers one at a time to layer name in variable ‘lay’

Command: tl + enter

Pick objects one at a time and their layer is changed to the layer in ‘lay’.

Copy an entity and change it to layer name stored in “lay”

Command: tll + enter

Pick objects one a time to copy them to the layer ‘lay.

Copy entities and change new entities to layer in “lay”

Command: ttl + enter

At the prompt select entities. This copies selected entities and changes their layer to layer ‘lay’.

 

Two-Key Commands

 

This is done with the command ggr that defines each subsequent key that you press on the keyboard to a unique script file that you create or overwrite. Each letter or number key followed by this command is assigned to run a script file. We have defined script file names as follows: for letter or number keys use the number 0 followed by the letter or number on the keyboard. For the letter ‘a’ the script file name is 0a.scr; for the number ‘1’ the script file name is 01.scr, and so on.

 

Note:

c:3 works with repeating crossing windows. Use cancel to end the command.

Initially the name in “lay” is set to “0”.

c:8 also sets layer variable “lay” to layer of entity picked. Using c:3 after c:8 changes entities to that layer.

Use Autocad’s undo command to undo after c:3 or c:5 with the sequence: Undo, enter, b (for back), enter.

 

Assigning commands from within Autocad

 

We do this by using script files. The command w1 is used to create or to overwrite an existing script file. The command w2 allows you to write more than one line to the script file. The script file may contain a single command or more than one command if Autocad permits this. It may contain a command followed by options for that command. The script gets executed when you enter its name at Autocad’s command prompt and press enter.

 

Assigning a command to run with a single key press

 

Edit acad.mnu.

Use the link above to see how to edit Autocad’s menu file acad.mnu.

After editing and loading the menu the available single keys that you can use to run a command are: Function keys F3 through F7, F9, F11, and F12, and Number pad keys 0 through 9. You are now ready to create a script file.

 

Write one line of text to a script file.

The names you may use for script files are listed here: Script file names.

A script file is a plain text file with the extension .scr. It may be used to run one or more of Autocad’s commands.

At the command promt enter Autocad’s command ‘script’ and press enter. Now, at the prompt enter the script file name you want to execute. Whatever is contained in the script file gets executed. The script file may contain just one line of text or more. For now, let us assume it has only one line of text which is an Autocad command.

You can create script files from within Autocad with the command w1. This lets you specify the name of the script file and what command it will contain.

 

Example: Assigning the function key F5 to execute the command ggr.

 

At the command prompt enter ‘w1’ and press enter. Now, enter 0f5 (that is the number ‘0’, the letter ‘f’, and the number ‘5’)  and press enter. This is the name of the script file you will be creating. Next, enter ggr and press enter. This creates a script file named 0f5.scr on your hard drive which contains one line of text that reads ‘ggr’.

Now, when you press the function key F5 it starts the command ggr.

 

Editing the acad.mnu file

Edit the accelerators section in Autocad’s menu file acad.mnu.

First, find ***ACCELERATORS in the file. Now, below the line [CONTROL+"L"]^O add the following lines:

 

["F3"]^C^C(command "script" "0F3")

["F4"]^C^C(command "script" "0F4")

["F5"]^C^C(command "script" "0F5")

["F6"]^C^C(command "script" "0F6")

["F7"]^C^C(command "script" "0F7")

["F9"]^C^C(command "script" "0F9")

["F11"^C^C(command "script" "0F11")

["F12"]^C^C(command "script" "0F12")

["NUMPAD1"]^C^C(command "script" "C:\\11\\001")

["NUMPAD2"]^C^C(command "script" "C:\\11\\002")

["NUMPAD3"]^C^C(command "script" "C:\\11\\003")

["NUMPAD4"]^C^C(command "script" "C:\\11\\004")

["NUMPAD5"]^C^C(command "script" "C:\\11\\005")

["NUMPAD6"]^C^C(command "script" "C:\\11\\006")

["NUMPAD7"]^C^C(command "script" "C:\\11\\007")

["NUMPAD8"]^C^C(command "script" "C:\\11\\008")

["NUMPAD9"]^C^C(command "script" "C:\\11\\009")

["NUMPAD0"]^C^C(command "script" "C:\\11\\000")

 

This defines these keys to run script files that you create with the command w1.

Omit any of these lines if you do not want to define a particular key. Load the menu with Autocad’s menu command. You may also redefine the function key F1 by including the line:

"[F1"]^C^C(command "script" "0F1")

 

Script File Names

The names of script files that may be used for function keys and number pad keys are:

 

Funcion Key

Script File Name (.scr)

F3

0f3

F4

0f4

F5

0f5

F6

0f6

F7

0f7

F9

0f9

F11

0f11

F12

0f12

Number Pad Key

Script File Name (.scr)

0

000

1

001

2

002

3

003

4

004

5

005

6

006

7

007

8

008

9

009

 

Note: These names were defined by editing Autocad’s menu file acad.mnu.

 

The names of script files that may be used to run the Two-key command initiator are as follows:

 

Letter Key

Script file

Letter Key

Script file

Number Key

Script file

a

0a

N

0n

1

01

b

0b

O

0o

2

02

c

0c

P

0p

3

03

d

0d

Q

0q

4

04

e

0e

R

0r

5

05

f

0f

S

0s

6

06

g

0g

T

0t

7

07

h

0h

U

0u

8

08

i

0i

v

0v

9

09

j

0j

w

0w