Take Me To Your Leader! (Learning Curve AutoCAD Tutorial)1 Apr, 2008 By: Bill Fane
This first in a series of articles discusses the many facets of the Leader command in AutoCAD.
Once upon a time, a long time ago, in an AutoCAD release far, far, away, there were only two ways to start an AutoCAD command. You could type it in at the Command prompt, or you could pick it from a menu bar that ran down the right side of the screen. This was back in the last millennium in the Kingdom of DOS.
And it came to pass that the Kingdom of DOS was replaced by the Empire of Windows, and many things changed. In particular, it became possible to launch a command in several different ways. You can now enter it at the Command prompt, you can pick it from a menu bar, you can use a shortcut, you can select it from a toolbar, or you can select it from a dashboard that runs down the right side of the screen -- hey, wait a minute, that last one sounds like a case of déjà vu.
In the fullness of time, additional commands were added, and AutoCAD became more powerful, and life was good.
Meanwhile, some commands were prolific and flourished, and they produced offspring. For example, Hatch begat Bhatch, and Text begat Dtext, which begat Mtext, and so on.
The leader in the fertility race, however, has to be the Leader command. So far it has produced the Leader command again and then Qleader and now Mleader. In addition, each of them has many variants. In fact, it has become so prolific that it could be the topic of an entire article or two.
Let's start by reviewing what a leader is and what it does. It usually consists of an arrowhead, a line, or series of line segments, and some text. It is often used to convey a piece of information and to indicate the point to which the information applies. For example, a leader might point to a location on a part and say "Kick it here."
These leaders were produced using four different commands.
Believe it or not, the four leaders in the illustration were produced using four different commands, and each has different characteristics as a result.
In the early days of the Kingdom of DOS, the dimensioning commands were not of the same family as the other commands, but were a tribe unto themselves. It required a special magic password to enter into the territory of this tribe in order to use its unique commands, and the manner of this password was the command Dim. This has nothing to do with intensity, nor with mental acuity.
The Dimensioning Code
When this token was invoked as a normal AutoCAD command, the Command prompt was transformed into the shape of Dim to indicate that you had gained entrance to this magic land.
All of the commands related to dimensioning were of the family of this tribe. Having entered into their domain, it became possible to invoke them. In order to return to the land of the normal commands, it was necessary to press the magic combination of Ctrl + C or to call upon the Exit command.
With the passage of time, as measured by the mystical unit called Version, the dimensioning commands became assimilated into the larger family of commands. It was no longer necessary to enter into their territory in order to summon them forth, but their tribe did not disappear. It still remains to this day as a secret society, unknown to the majority, but able to be called upon by the knowledgeable few.
At the Command prompt, enter the Dim command. The Command prompt now displays as Dim.
Enter the Leader command or just the single letter L, and then select a starting point as prompted. Observe how it now behaves much like the Line command, in that it keeps prompting for successive To Point locations. You can enter as many successive points as you want.
When you press Enter instead of picking a point, Leader draws one more short horizontal line, and then prompts you to enter your desired text. You are allowed one line of text. When you press Enter, the command terminates and returns you to the Dim prompt.
Press Esc to return to the Command prompt. You have now produced a sample like Leader 1 in the illustration.
Now let's see what we have wrought.
I Am Your Leader!
Start the List command (Tools / Inquiry / List) and select all objects that make up the leader. A quick inspection reveals that it is composed of three different object types:
The text is an mtext object. Earlier releases used single-line text because that was the only kind you had. To be compatible with older scripts and other customizing, the Dim Leader command lets you enter only a single line of mtext, but you can edit later to add more lines of text. On the other hand, earlier AutoLISP routines that analyze the leader text will not be compatible because they will be looking for text, not mtext.
The line segments are indeed line segments.
The arrowhead is a solid. No, this is not a 3D solid but is instead a solid-filled outline object left over from the earliest releases.
As you may have guessed, almost nobody uses the Dim Leader command anymore. The only reason I introduce it is that you may encounter examples in older files.
All Hail the Leader!
Now let's look at Leader 2. To produce one like it, start the Leader command from the Command prompt. As with Dim Leader, there is no menu or toolbar pick to invoke it in current releases of AutoCAD.
Again, as with the Dim Leader, it prompts for a start point and then a second point. The prompt now changes.
If you press A and then Enter, or just press Enter, it draws one more short horizontal segment and then prompts you to enter the first line of text. Do so, and press Enter. It repeatedly asks for more text until you press Enter without supplying any text, at which point the command terminates.
Once again, let's perform an autopsy on our new leader. Use the List command and select everything. It contains just two objects: a piece of mtext and a leader object. The latter looks very much like a multisegment polyline (pline). The arrowhead is part of the leader object.
Following the Leader
The leader and the mtext are linked associatively, so that if you move the text, the end of the last segment of the leader will move with it.
On the other hand, the converse is not true. If you move the end of the leader line, the line moves but not the text. On the other hand (wait a minute, how many hands is that?), the associativity is not lost so that subsequent moves of the text will still move the end of the leader.
Run the Leader command again. Pick the start and next point, and then look at the options:
U for Undo will step back one point selection.
F for Format has four sub-options:
- S turns the leader lines into a smooth, flowing spline curve.
- ST turns them back into straight segments.
- None turns the arrowhead off.
- Arrow turns it back on.
Now here is the cunning bit: the formatting is not actually applied until the command completes, so you can come back in the middle of the command and change your mind. The arrowhead and text style and placement are all determined from the current dimension style.
The Leader command can also be used to produce splined leaders.
Here is an even more cunning bit. When you are asked for the first line of text, just press Enter. This brings up yet another sub-subprompt:
It's T Time...
T for Tolerance brings up the Geometric Tolerance dialog box. Fill in the appropriate squares to produce a Geometric Dimensioning & Tolerancing (GDT) symbol at the end of the leader line.
Copy lets you select any object or set of objects in the drawing. It copies them to the leader as its annotation and then terminates the command.
Block inserts any existing block definition as the annotation. Unfortunately it does not bring up the Insert dialog box but instead requires you to enter the block name, scale factors, and rotation angle directly at the Command prompt.
None completes the command without any annotation, so you just end up with the arrowhead and the leader line or lines.
Mtext drops you directly in to the Mtext Format Text editor.
Okay, Who's the Leader Here?
Believe it or not, I still have two Leader commands to go. Be sure to come back next month when I cover them, but I'll give you a bit of a hint: a Qleader (Quick Leader) ends up looking exactly like a leader except that it uses a dialog box instead of all the Command prompt inputs to apply the various options, while the Mleader (Multi-Leader) command, new to AutoCAD 2008, produces a whole new object type with a big bunch of interesting characteristics.
And Now For Something Completely Different
If a gasoline engine has been left standing for a long time, perhaps several years, the gas left in the carburetor turns to a thick, gooey crud and a hard varnish that can be extremely difficult to remove.
Fortunately there is a simple solution. Just mix lemon juice about 1:10 with hot water and immerse the parts in it. Let stand until it cools and the crud will now just rinse out. The secret is the ascorbic acid (vitamin C) in the juice.
See, vitamins are good for you.
In her easy-to-follow, friendly style, long-time Cadalyst contributing editor and Autodesk Technical Evangelist Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD video tips. Subscribe to the free Cadalyst Video Picks newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!