Вы находитесь на странице: 1из 23

Take Me to Your Multileaders

Dan Abbott Southern Maine Community College

GD305-4P

Is there more to the new multileader entity than meets the eye? This workshop will start with a quick overview of the new multileader capabilities in AutoCAD 2008 and the relationships between leaders and their associated annotation. We'll look at how the new annotative function works with mulitileaders, how nested block references behave when used as annotation, and several strategies for managing multileaders. We'll also consider some potential uses that may not be obvious, and look for some possible problems when using prior releases and updating existing drawings. We'll finish up by seeing how they are handled in AutoLISP, VLISP, VB, and .NET. Target Audience/Who Should Attend Experienced AutoCAD Users and CAD Managers Session Objectives After attending this session, you will be able to: Create and manipulate multileaders and their annotation. Recognize the pros and cons of placing multileaders in model space or layouts. Avoid unforeseen problems when working with earlier releases and applications. Utilize sample code for creating and manipulating multileaders. Manage multileaders as part of a consistent dimensioning and annotation strategy.

About the Speaker:


Dan is a professor in the Architectural and Engineering Design department at Southern Maine Community College. In addition, he trains industry professionals in AutoCAD use and management, AutoLISP, and geometric dimensioning and tolerancing (GDT). In his 10 years of presenting at AU, he has received three Top Speaker awards. Dan is also the author of a book, AutoCAD: Secrets Every User Should Know (Sybex press, 2007). He can be reached at www.danabbott.com or dabbott@smccme.edu. Paul Richardson contributed most of the sample code for this paper. He is an applications engineer and owner of CAD System Engineering who uses VBA, C#, and .NET, as well as VLISP and AutoLISP. Paul is also a visiting assistant professor in the Architectural and Engineering Design department at Southern Maine Community College. He can be reached at www.richcad.com or prichardson@roadrunner.com.

Take Me to Your Multileaders

page 2

The theme of this year's power track in AutoCAD is "Do it Once." When it comes to multileaders, that's very good advice. Automate the placement of Multileaders as much as possible. This workshop will give you some tips for "doing it once" with multileaders, using a variety of customizing and programming approaches, while warning you about some potential pitfalls. This workshop will consist of four parts: Which leader tool should you use? Review of Multileader commands Problems and Solutions Customizing Examples First, a recommendation: install AutoCAD 2008 Service Pack 1, available at http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=10035892&linkID=9240618 It corrects several problems with multileaders, including: The location of attributes in a multileader block is no longer off-center. Multileader text no longer unexpectedly rotates in user coordinate systems. Multileader attributes are no longer off-center in a rotated UCS.

Which Leader?
Multileaders, as their name suggests, are used to attach annotation to multiple leader lines. Multileaders and their associated commands can be accessed from the command line, the Multileader toolbar, the dashboard, the drop-down menu, or from a tool palette. Multileaders are also one of the objects that can be annotative, which can lead to problems if you save a drawing to an earlier releasemore on that later. Since there are now three commands (in addition to DIMRADIAL and DIMDIAMETER) that can be used to create leaders in AutoCAD -- LEADER, QLEADER, and MLEADER -- let's start by sorting them out. Tip: Don't use multileaders, or leaders to dimension circles or arcs. Use DIMRADIUS or DIMDIAMETER instead. The form will be correct, and the value will be associative. LEADER and QLEADER LEADER is the command-line version of QLEADER, and like QLEADER it will create two separate entities -- a leader and annotation -- whose properties are based on the currently defined DIMSTYLE. If the DIMSTYLE is annotative, both the leader created and the annotation will be annotative. You may get a dialog box giving you a choice about what scale to assign to the object as it is placed. Only

Take Me to Your Multileaders

page 3

one scale can be selected when placing an annotative object, but once the object is placed, the right click menu contains an option for assigning additional annotative scales. Why LEADER instead of QLEADER? LEADER gives you command line options that can be used in a menu macro or AutoLISP function to automate the placement of leaders. So, for example, if you wanted to create a pulldown option, tool button or Tool Palette object that would always place a leader using a DIMSTYLE named "DimLeader" that includes a specific dynamic block named "TAG-DYN," you could use this macro to do so (it requires the selection of three points for the leader): ^C^C-dimstyle;R;DimLeader;leader;\\\;;b;TAG-DYN;@;;;; Why either LEADER or QLEADER instead of MLEADER? If you work with offices that use an earlier release of AutoCAD, you may have to save a drawing to an earlier format. If the drawing includes MLEADERS that are annotative, they can't be edited in the earlier release (and may not display, depending on the settings that control proxy entities). If you try to edit them by exploding, they will disappear from the drawing's database. See the later section on zombie entities for a discussion of this surprising behavior. Both LEADER and QLEADER allow you to use dynamic blocks for annotation, which you can't do with MLEADERS. That, I can only assume, is an oversight that will be corrected in a future release. LEADER and QLEADER can use tolerance frames as annotation objects, which you can't do with MLEADERs. That's probably not much of a limitation since tolerance frames are nearly always applied to a single feature, but on occasion tolerance frames are used to control two surfaces as though they were a single surface, and a tolerance symbol with two leaders could be used to designate that. LEADER and QLEADER create entities whose properties are controlled by the current DIMSTYLE, so using either of them assures that your annotation will be consistent with dimensions. Multileaders are not affected by the settings in a DIMSTYLE because they have their own style definition. Of course, you would probably make sure that the features of both DIMSTYLE and MLEADERSTYLE match when creating a template file. Both permit you to use different annotation scales for the leader and the annotation, if desired. However, if the annotation used is a block, the annotative property for both the block and dimension style must agree at the time you place the leader. This presents a problem, since the only obvious place to make a block definition (as opposed to a block reference) annotative is in the standard BLOCK definition dialog box. This works for making an existing non-dynamic block annotative just open the BLOCK dialog box, select the block definition, and check the "Annotative" box.

Take Me to Your Multileaders

page 4

But how do you make an existing dynamic block annotative? If you try using the BLOCK command to make an existing dynamic block annotative, the dynamic properties of the block will be stripped from the block definition. (This will also happen if you try to remove the annotative property from a block definition.) If you want a block definition that is both annotative and dynamic, you'll have to use the BLOCK command to make it annotative, and then use BEDIT to add the dynamic properties. MLEADER So what are the advantages of the MLEADER command? It creates a single entity that can be manipulated by changing its MLEADERSTYLE so that all existing MLEADERS can be updated automatically. Even though LEADER and QLEADER use DIMSTYLE settings to control the appearance of the LEADER and annotation entity that they create, the two entities are independent of each other. Updating the Dimension Style used to place the leader will affect the leader, but will have no affect on annotation text. It is very easy to add frequently used notes with one command by creating an MLEADERSTYLE with default text for each note. Additional Leader Lines can be added to and deleted from the same annotation easily.

Other tools make it easy to edit and manipulate the resulting leaders so that annotation is aligned, or related annotation blocks are grouped together. You can change the default behavior if you want to select a starting point other than the tip of the leader arrow when placing a leader. Whatever you choose will be persistent until you alter it. MLEADERS as annotative objects MLEADERS can themselves be annotative objects, but you should be cautious about using entities for annotation that already have an annotative property. You can't use an existing annotative block definition, for example, with an MLEADER. The MLEADER command just won't recognize the block name. You can use a non-annotative block definition that contains attributes that are annotative, but that can result in unpredictable scaling of the attribute when the block is inserted with the MLEADER command. And, if you try using an annotative block definition that contains annotative text, the text is very likely to disappear when you create viewports at different scales, even though the leader part of the MLEADER scales properly. You can't use annotative block references with MLEADER, and you should avoid using block references that contain any annotative entities attributes, text, or nested blocks.

Review of Multileader Commands


There are a number of commands that are associated with MLEADER.

AIMLEADEREDITADD and AIMLEADEREDITREMOVE These are the commands issued by selecting one of the buttons shown from a toolbar or the dashboard. They are used to add leaders to or remove them from an existing MLEADER entity. They're not really meant to be used from the command line, and aren't listed in the command reference. Commands beginning with the letters "AI" are AutoCAD commands that are meant to be called through a menu interface. So you're not likely to use AIMLEADEREDITADD except in a menu or lisp program. The macro used for the Add Leader button is ^C^C^P_aimleadereditadd ^P. The ^P turns off the command line display prior to issuing the command and then turns it back on so you won't see the unfamiliar command name displayed at the command line. If you want to use an AI command, including this one, in a LISP program, it can be called as follows: (command "_.AIMLEADEREDITADD"). Note that the underscore and period preceding the command name are not needed, but the underscore internationalizes the command, and the period calls it even if it has been undefined in the current session. CMLEADERSTYLE This variable controls the current MLEADER style. It acts as a command when typed directly at the keyboard, but as a variable when used in an AutoLISP program. If you want to get the name of the current MLEADER style and bind it to a variable, use this format: (setq currentMleaderStyle (getvar "CMLEADERSTYLE")). If you want to set a different style use this format: (setvar "CMLEADERSTYLE" "Annotative"). The style name you use must exist in the drawing database. A new drawing contains two MLEADER styles if you start a drawing using any of the provided template files. However, if you start a drawing with no template, there will be only one default style "Standard" and it will be based on inches whether you select "Imperial" or "Metric to start. Probably an oversight that will also be corrected.

MLEADER [MLD] This is the command used to create MLEADERS. Like QLEADER, you have to select your options before you select a start point, but all of the options are at the command line. If you place some text as the annotation for an MLEADER, and later want to use MLEADER to place a block, you must decide this before selecting a start point. There are a lot of options for this command, making MLEADER a prime candidate for automating so you only do it once. Let's go through them all. Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>: This command retains the most recent of the three options you selected for the initial point selection. The first time you use it, you'll be prompted to select an

Take Me to Your Multileaders

page 6

arrowhead location. However, you can elect to type "L" and select the location of the landing (depending on which reference you read, this end of the leader is called a "landing," a "dogleg," or a "hook line") or type "C" and select the location of the content. Typing "O" for options opens up a new set of options. Oddly, unlike the selection you make for which element of the MLEADERS to place first, AutoCAD will not remember your choices for any of these options when you go to place subsequent MLEADERS. This is a pretty good incentive to create multiple MLEADER styles that can be set prior to placing an MLEADER (or selected after the fact in the Properties Palette or the Right-Click menu for MLEADERS.) If you create a multileader without first creating a multileader style, you can use it to create a new style with the right-click menu that pops up when a multileader is selected. However, not all the options settings will be included in the new style Maxpoints, for example so you still may have to use MLEADERSTYLE to edit the new style to get the results you want. Enter an option [Leader type/leader lAnding/Content type/Maxpoints/First angle/Second angle/eXit options] <eXit options>: Leader type Select a leader type [Straight/sPline/None] <Straight>: Selecting any of these three will simply set that as the leader type. If you select "None" you will be asked for the location of the content. If you choose to do so later, you can add a leader using the MLEADEREDIT or the Add Leader button from the dashboard or the toolbar. You might choose to use this option to automatically insert some default text using a specific MLEADERSTYLE. However, you will have to set that style current before using the MLEADER command since there is no option for changing the MLEADERSTYLE within the command itself. leader lAnding Use landing [Yes/No] <Yes>: Specify fixed landing distance <3.0000>: No surprise here. If you select "No" you'll have a leader, but no landing. If you select "Yes," you'll be prompted for a fixed length, in this case 3 units because the leader is intended to be used in a metric drawing. Content type Select a content type [Block/Mtext/None] <Mtext>: Block Don't be fooled into thinking that every block definition can be used if you select this option. If you specify a block name that's annotative, you'll get an error message "Invalid input" instead of the block. If you give the name of an existing dynamic block, you'll get no error message, but the resulting dynamic block properties won't be accessible unless you explode the multileader.

Take Me to Your Multileaders

page 7

This effectively makes a dynamic block unusable in a multileader. In fact, it makes any block definition that is nested in another block definition unusable as well. If you nest a block containing attributes in another block definition, you would not be able to edit the attributes unless you exploded the block (true of any block). If you then used the block definition in a multileader, you'd have to explode it twice to get to the attribute information. You can, however, use a block in a multileader that was defined with attributes, as long as they aren't nested in another block definition. So, just keep it simple when creating block definitions. Mtext You have no controls over how text is justified in a multileader unless you've defined a multileader style with the justification you want. Yet another reason to use named styles. There are a couple of other quirks with MTEXT as well. One is that the Mtext object's bounding box is used to determine the location of a landing. This won't cause any problems if the text is justified to the side from which the landing leads, but if it leads from a ragged edge, the gap can be huge.

The other quirk is the edit window you get for typing text. It looks more like the DTEXT window than the standard editor. That's because leaders so often contain only a single line of text. If you want a paragraph of text, just select the "Full editor" button and it will open. The resulting text box will have a zero width, however. Use the properties window to change that after placing text. Tip. Get in the habit of using the full editor if paragraphs are your normal annotation type. Anything you type into the initial window will be lost if you decide to switch to the Full Editor after beginning to type. It would be nice if the full editor just opened up if you press the Enter key for a new line, but it doesn't. An Enter is equivalent to OK.

None This is pretty clear. Select "none" and you get no annotation, just an MLEADER. Can you add annotation later? Maybe. If you use the Properties palette to change the style to one that specifies MTEXT as the annotation, but doesn't specify default text, you'll have an empty text

Take Me to Your Multileaders

page 8

box. Otherwise, you can specify a different multileader style, but if that style references a specific block definition or a string of default text, it won't be displayed. Maxpoints Enter the maximum points for leader line <2>: You can enter any integer up to 32767, in keeping with the AutoCAD tenant that "excess is not enough." If you are done picking points prior to reaching the maximum, you can press the spacebar to terminated the selection process, at which point a landing will be placed and you'll be prompted for the content. If you leave the number set to 2 you'll get a leader defined by those two points, PLUS a landing (unless, of course, you suppressed the landing itself). First Angle Enter first angle constraint <0>: This is an incremental, not an absolute angle. If you type "45" your leader line between points one and two will be constrained to 45 degree increments, allowing an absolute angle of 0, 45, 90, 135, 180, 225, 270, and 315. The default angle of 0 indicates that there is no constraint on first angle placement. In other words, the increment is 0 degrees, but this is NOT an absolute angle of 0 degrees. (Typing 0 when defining a Multileader Style, however, results in a 90 degree constraint, oddly enough). Note. The only incremental angles allowed for either the first or second angle constraints are 0, 15, 30, 45, 60, 75, and 90. This matches typical drafting standards, but is a departure for the normal AutoCAD behavior for input.

Second angle Enter second angle constraint <0>: Although you can set a second angle constraint, it will only affect leaders with a Maxpoints setting of three or more. It constrains the angle between the second and third point selected to the increment given. Zero means it is not constrained at all. If you type 90, the second segment of the leader will be limited to absolute angles of 0, 90, 180, and 270. eXit options Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>: MLEADER has nested options that are a lot like those in the PEDIT command. You have to type "X" to get back one level to where you first entered Options.

Take Me to Your Multileaders

page 9

Editing Multileaders Once you've created a multileader, you can manipulate it in several ways, including the dedicated edit commands (see MLEADEREDIT below), the right-click menu, the properties palette, and grips. Right-click menu The right-click menu includes many options that apply to all entities. The circled options are specific to MLEADERS. "Add Leader" and "Remove Leader" issue the AIMLEADEREDITADD or AIMLEADEREDITREMOVE command. The Multileader Style option brings up the first seven of the multileader styles that exist in the drawing. It is also where you can create a new style from an existing MLEADER, although the style will not include all of the options you may have used to create it. "Other" opens a new dialog box with a list of all styles and a scroll bar that allows you to see more than the first seven. Properties Palette The properties palette allows you to change most features of one or more existing multileaders and is the only convenient way to set a width for the text box used as annotation. This is an odd limitation of the MLEADER command. You are never asked to set a width, nor can you use grips to change the text box width after the fact as you can with QLEADER. You have to place the multileader, determine the width you want, and then change that property using the properties palette. The Landing gap is the gap between the end of the landing and the text box (not necessarily the text itself see earlier section). Note that you can change properties of both the leader, and the annotation. However, if the multileader includes a user-defined arrow head, you can only change to one of the default arrowheads. You can't select a different user-defined arrowhead here. You would have to create an MLEADER style that uses the desired arrowhead and change to that style. In this image, the annotation is text, so the options are those that you would have with MTEXT, with the same limitations for line spacing that you would have with MTEXT. If you have a single line of text to add to a multileader, add it directly. If you have multiple lines of text, type a small amount of it, exit the text editor, set the desired width, and then edit the result in the full text editor. It gives you a better sense of what the result will look like as you're typing.

Take Me to Your Multileaders

page 10

Grip Editing Although you can't edit the annotation itself with grips, you can use four grips to alter the leader and the relationship between the annotation and the leader. The two arrow grips on either end of the landing will stretch the landing from one end or the other. Using the copy option of grips will result in multiple copies of either the leader or the text, depending on which end you select. The arrowhead has it's own grip. Selecting either the move landing or the move annotation grip will actually move both. Text Edit If you use DDEDIT [ED] to edit annotation text, the default editor is the line editor unless the text has more than one paragraph, no matter how long that single paragraph is. To switch to the full editor, select the Full editor button. Palettes Multileaders lend themselves to customizing by being added to a tool palette. In fact, there is a default leader tool palette that you can use as a starting point. It includes both metric and Imperial versions of the standard multileader options: no annotation; text; and each of the block options circle, box, hexagon, triangle, slot, and detail bubble. Since Multileader Styles cannot be copied using Design Center, use of a tool palette is a good idea. The default tools each have the style set to "use current," which you should change to a named style. Once a named style is specified, that style is added to the drawing along with the multileader as defined. This is true even if you never saved the drawing in which the multileader was originally defined. MLEADERALIGN [MLA] This command allows you to manipulate multiple MLEADERs so that they line up in a variety of ways. The prompt at the command line is: Select multileaders: Specify opposite corner:

Take Me to Your Multileaders

page 11

You can select any number of multileaders at this prompt, but it wouldn't be logical to select only one. Once you've selected the multileaders, you're prompted to select the one you'll use as a reference, or O for Options.
Select multileader to align to or [Options]:

There are four alignment options.


Enter an option [Distribute/make leader segments Parallel/specify Spacing/Use current spacing]

"Distribute" will space the leader annotation entities equally between two points you select. The insertion points of each annotation will be aligned along the path between the two points. The three examples below each started with the group on the right and demonstrate vertical, angled, and horizontal point selection.

"make leader segment Parallel" will prompt you to select a reference leader. Note in the illustration that only one leader from each multileader is actually parallel to the reference leader. Each of the others either stayed the same or moved to a new nonparallel angle. "specify Spacing" does the same thing as "Distribute," but instead of spacing each multileader evenly between two points, it allows you to specify a value and uses a reference Multileader as the base. The two points you select will determine the angle, but not the spacing. "Use current spacing" maintains the existing spacing among the multileaders while using the two points to determine the angle.

Take Me to Your Multileaders

page 12

MLEADERCOLLECT [MLC] This command affects only those multileaders that use a block as annotation. If your select set includes multileaders that contain Mtext, they'll be filtered out. Select multileaders: Specify opposite corner: 13 found 12 were filtered out The purpose of this command, is to gather the annotation blocks from more than one multileader into a group. This is most likely to be used when multiple references to individual notes apply to the same feature. It is possible to include far more individual blocks than you are likely to use. If you select the group using a window, crossing window, fence, WP or CP, the collected blocks will be in the reverse order in which they were created, and the multileader that was created earliest will be used as the base leader for the group. If you select the multileaders individually, they will be arranged in the order in which you picked them, with the last one selected used as the reference leader for the group. Only a multileader whose leader line is used is actually connected to the resulting multileader. The other blocks are floating in alignment with, but are not actually part of, the same multileader. If the reference mleader has multiple leader lines, the group will also have multiple leader lines. If the leaders are placed on either side of the group, than two members of the group have a leader attached and the ones in between are floating. Select multileaders: Specify opposite corner: 10 found Specify collected multileader location or [Vertical/Horizontal/Wrap] MLEADEREDIT [MLE] MLEADEREDIT allows you to select a single multileader for editing. It's only options are to add or delete a leader line.

Take Me to Your Multileaders

page 13

MLEADERSTYLE [MLS] The MLEADERSTYLE command is used to create, set, or modify a multileader style using the Multileader Style Manager dialog box. It is similar in structure to the Dimension Style Manager, but the changes are not saved as variables, so you can't use scripts, or simple LISP programming to create a new one. A MLEADERSTYLE is a dictionary object in AutoCAD, so although the settings for a particular style are saved in the drawing, you can only manipulate them through the Multileader Style Manager, or by programming. Once a style exists, it can be set from the command line (using CMLEADERSTYLE), the Style toolbar, the dropdown window of the multileader toolbar, or the drop down window of the dashboard. Limitations Multileader Styles have some limitations. You can't move them from one drawing to another using Design Center, and you can't export the styles. I think this will be corrected in future releases, but there are several options for using MLEADERSTYLEs in other drawings. Create a drawing file with all of your MLEADER styles, add any blocks you might want to use for arrowheads, set a text style that is appropriate, and save the file. Now you can insert the DWG file into any other drawing to import Multileader Styles. Drag an example of each MLEADERSTYLE to a tool palette and use it from there. Add all of your Multileader Styles to your office .DWT files.

You can't rename or delete the MLEADER style named "Standard." Too bad, but just never, ever, ever use the name "Standard" for an MLEADER style nor a dimension style, text style, table style, or anything else. If at some point you insert that drawing as a guest into a host drawing -- or use it as an external reference and later bind it -- you will create a conflict between two different MLEADER styles with the same name. The guest always loses that conflict. MLEADERSTYLE options There are three tabs in the MLEADER style manager.

Take Me to Your Multileaders

page 14

Leader Format Type: You can define a style with a leader line type of Straight, Spline, or None. Color, Linetype, and Lineweight: Up to you, but I'd recommend leaving these set to ByBlock and controlling all three using layer controls. Arrowhead You can use any of the standard arrowhead symbols from the dimension style manager here, or you can specify a user defined block. If you want your own arrowhead, create it at a length of one unit, point it to the right, and select the point as the insertion point. Break Size Should you elect to break a leader where it crosses a dimension or extension line, you can specify the size of that break here. Use caution, however. Adding too many breaks to annotation can result in a linetype confusion. That's why the ASME Y14.5M standard prohibits breaking dimension, extension, and leader lines in most situations. Leader Structure Constraints These selections limit the options for shape when you add a multileader with this style: how many points you can select before a landing is added, and the incremental angle used to place a first segment and a second segment, if there is one. If you don't want any constraints, clear the check boxes rather than entering zeros. Unlike the command line options of MLEADER, a zero actually constrains the segments to 90 degree increments. Landing settings You can opt to terminate a leader with no landing. This is required if you elect to set the text angle to either "as inserted" or "always right reading" in the content tab. The landing distance is the length of the landing itself. This could be as small as .12" or 3 mm to reduce the space occupied by a leader.

Take Me to Your Multileaders

page 15

Scale This is where you decide whether to set a scale directly (the reciprocal of the plot scale to be used), have multileaders scale automatically based on the scale of the floating model space viewport through which they are placed in model space, or scale based on specific annotative scales assigned as properties to the multileaders. Although I generally like the new annotative properties, in this case, I would opt for "Scale multileaders to layout" to avoid one very vexing problem with annotative multileaders. (See "Problems"). Content Multileader type: Select Mtext, Block, or None. The remaining options will change, depending on the choice you make here. Select "Mtext," to get the options shown. Select "Block," to get block options. If you select "None," you get no options. Default text: This is a very useful feature. Select the ellipses button [] and you can type in any text string to be inserted when you use this Multileader style. If you have a number of standard notes you use regularly, you can create a tool palette, define a different style for each note, place a version of each on the tool palette, and automatically insert the standard text when needed. Unlike tying to accomplish the same thing with a block definition, you can easily edit the text placed in this way. If there is no default text, the text entry editor will be shown when the style is curren5t at the time you place a Multileader. Text style: Select any existing text style. Unfortunately, there is no ellipses button here to allow you to create a text style if you neglected to do so before entering this dialog box. That is a surprise, given that the dimension style manager has that feature. Text Angle: This option had me stumped initially because the three options Keep horizontal, As inserted, and Always right-reading are all horizontal unless you've cleared the "Automatically include landing" check box in the Leader Structure tab. Once you've done that, these settings differ as shown. Text Color: This could be useful if you want your text to plot with a different linetype or shading than the rest of the multileader (assuming you're using color tables for plotting).

Take Me to Your Multileaders

page 16

Text Height: Depending on your selection of a scale setting in the Leader Structure tab, this will either control the absolute text height, or the paper space text height i.e. the height at which the text will actually plot. I'd recommend that you set scale to "Scale multileader to layout," so you would set this to the desired plotted height, which would normally be from .1 to .12" or from 2 3 mm. Make sure your text style has a height of zero. Always Left Justify Check this box to prevent forced right-justification whenever you have a leader line going to the right. Right justified text is harder to read than left-justified text, so I'd recommend checking this. However, that may cause the landing gap to be larger than intended, since the gap is measured from the text boundary, not the text. Another problem occurs if the Mtext width is changed after its placed. The landing won't move to close up to a new width, which isn't a problem with right-justified text. The fix is to change the Multileader Style to frame the text, exit the Multileader Style Manager, then reenter it to clear the frame. This will force the gap to close to the new boundary.

Leader connection Leaders attach only to the right or left of text. This window controls the attachment points as shown. Landing gap: This is the gap between the landing and the boundary of the MTEXT.

Take Me to Your Multileaders

page 17

Content Tab Block When you select "Block" as the Multileader type, you have three options for content. Source block: This can be one of the default definitions supplied, or a nonannotative user-defined block. As indicated earlier, avoid using a block definition that contains any annotative entities, and note that dynamic blocks won't be usable here, which is a shame. Attachment: This one is a bit odd. You have the choice of attaching the landing directly to the insertion point of the block definition, or to the edge of the entities used to define the block. Center behaves somewhat like a centroid in a region, averaging the location among the various entities that make up the block. If the landing bumps into an entity on the way to that centroid, it stops. If it doesn't, it goes all the way to the centroid. If you select "Insertion Point" the landing will go directly to the insertion point UNLESS it bumps into an entity on the way, at which point it will also terminate. However, moving the multileader will often force both leader lines to the insertion point.

Problems and Solutions


I discovered a number of concerns about Multileaders when I reviewed AutoCAD user groups questions. Those that weren't addressed earlier in this paper appear here. Earlier Releases An MLEADER with annotative scales can create problems when opening an AutoCAD 2008 file in an earlier release. You may not be able to see them, and you cannot edit them in the earlier release. To reduce those problems, make sure that you do the following before saving the file that contains Multileaders:

Take Me to Your Multileaders

page 18

Select the check box for "Maintain visual fidelity for annotative objects" in the Open and Save tab of the Options dialog box. (Set SAVEFIDELITY = 1). This makes the drawing file larger, but maintains the appearance of the multileaders in each viewport when viewed in earlier releases. Set PROXYGRAPHICS to 1 before saving in AutoCAD 2008.

Set PROXYSHOW to 1 before in the earlier release of AutoCAD before opening the drawing.

The illustration above shows two annotative Multileaders; one with three annotative scales, and one with a single annotative scale. When selected in AutoCAD 2008, they are displayed as on the left. When opening in an earlier release (provided all three variables are set as indicated earlier) they are displayed as on the right, whether or not they are selected. Freezing by current viewport is used to maintain their "visual fidelity" in layouts in which they appear at different scales. All very nice. However 1. 2. They can't be edited in the earlier release. Although each Multileader is an anonymous block, it can't be redefined.

3. If exploded, the anonymous block entities completely disappear from the drawing. Attempts to convert these anonymous blocks into entities that could be edited in the earlier release are unsuccessful, because the proxy objects are defined using three entities, each called an AcDbZombieEntity in the drawing's database. Multileaders are the only annotative objects that cannot be exploded in an earlier release. 4. Three new layers are added to the drawing when opened in the earlier release. Since in the original drawing these blocks were inserted onto layer 0, in this case they are named 0@0.5, 0@1, and 0@2, representing each annotative scale assigned to the Multileader (1:2, 1:1, and 2:1). These layers should be left alone in the earlier release. They are created only to maintain the visual fidelity of annotation objects using Freeze in current layer. 5. A drawing file edited and saved in an earlier release often requires recovery when opened in AutoCAD 2008. Placement in Tables: Mleaders can be placed in a table, but only if converted into a block definition.

Take Me to Your Multileaders

page 19

Can Multileaders be made unexplodable? No, but you can put them on a locked layer. Can Annotative mleaders have a default annotation scale? Set a default annotation scale with CANNOSCALE. You get the following prompt: [Enter new value for CANNOSCALE, or . for none <"1:1">:]. This isn't as easy as it looks. You must enter a scale name that is currently on the scale list. By name, I mean the literal string used by AutoCAD to identify the scale. So 1/4" = 1'-0" will work, but 1/4"=1'-0", will not. What's the difference? The spaces around the = sign. Luckily, if you want to set a default style, you can select it from the scale list by using the annotation scale button in the status bar. If you should want to set a current scale using lisp, or a menu macro, you'll need to know the actual string used by AutoCAD to define the scale. A real number will be rejected. You can avoid typing errors by doing this: Select the Annotation Scale drop down list arrow. Select the scale you want. Type the CANNOSCALE command. Press F2 and copy the resulting scale name to the clipboard. Paste it into your LISP program or your macro window.

The value of CANNOSCALE is saved in the read-only variable CANNOSCALEVALUE as a real number. But CANNOSCALE still won't accept a real number. So a CANNOSCALE of 1:1 results in a CANNOSCALEVALUE = 1.000000000 (read only). A scale of 1/2" = 1'-0" has a CANNOSCALEVALUE = 0.041666667 (read only). Can multiple annotation scales be applied to an Multileader? This can be done using the properties palette, or you can use MATCHPROP to copy all of the scales from one annotative object to another. Rotating with a named UCS: Before Service Pack 1, users found that the text object of an MLEADER would plot at a rotation of 90 degrees if a named UCS were current and the drawing was saved and reopened. That problem could be avoided by resetting the WCS, but it has been fixed by SP1. Repeating from Tool Palette: Using ENTER to repeat the placement of an MLEADER that has first been placed from a tool palette isn't consistent with other commands. The MLEADER takes on the current MLEADER style, and is placed on the current layer, no matter what the setting is on the tool palette tool itself. Other settings for the MLEADER are honored, however, including any default text string. This Tool Palette problem was worse prior to Service Pack 1, but this little glitch makes it a good idea to place each MLEADER from the tool palette directly. This irks those of use who use time sensitive right-clicking to speed up repeating commands, but that's the way it is.

Take Me to Your Multileaders

page 20

Hatch Area: If the leader of an MLEADER crosses a closed area, it is seen as a boundary when picking a point for hatching that area even though a standard LEADER will not affect a closed area. To avoid this, you must either select a closed object for hatching (instead of selecting a point) or freeze the MLEADER layer before hatching. Rotated Annotation: If an MLEADER has to be rotated after being placed, the text is no longer horizontal, even if "Keep horizontal" is selected for the Multileader Style. How can the text be made horizontal? I can't find any non-programming way to rotate the annotation after the fact, even if it is an MTEXT entity. It looks like you can, since the text rotation angle displayed in the Properties Palette is not grayed out. In fact, you can even type in a new value. But it doesn't do anything, and reverts back to the existing angle as soon as you press enter. I have two indirect solutions: Rotate the entire MLEADER so the text is horizontal, move it into place, and then move the arrowhead using its grip. Redo the MLEADER. To reduce the amount of work this entails on a large amount of text, explode the MLEADER first, open the text in the MTEXT editor, and copy it to the clipboard. Now you can paste it into the MLEADER when you recreate it. Can MLEADER styles be made part of the STANDARDS command? Not yet. Can MLEADER styles be created using scripts? They can't, because they don't use AutoCAD variables to hold their settings the way that Dimension Styles do. Can existing LEADERS be converted into MLEADERS? I asked Paul Richardson to write a program to do that. I will post his results in the AU Online download site for this workshop. Can blocks be scaled in an MLEADER? There is no block scale option. You have to redefine the block if the annotative scale assigned to the whole MLEADER doesn't do what you want. How can the default blocks for MLEADERS be edited? Definitions for these blocks aren't accessible until they are placed in the drawing. Then they have the following names and can be edited using BEDIT: _DetailCallout, _TagBox, _TagCircle, _TagHexagon, _TagSlot, _TagTriangle. Changing the MLEADER style to one that uses a different block doesnt work. It doesn't. Change this in the Properties Palette for each Multileader.

Customizing Examples
Multileaders present more customizing challenges than I had expected. For this section, let's start with some basic macros and AutoLISP customizing. Space limitation prevent including most programming examples in this paper, but I will post a considerable amount of Paul RIchardson's heavily annotated code at AU Online after the conference is complete. His comments will clear up a lot of the mystery with this complex object.

Take Me to Your Multileaders

page 21

Macros You can't define new styles with macros, so you have to use a template that already includes the styles called by a tool button macro. A macro that will set the annotative scale to 1:2, make the style "AU" current, and place a leader using content first would look like this in the CUI. You can make any changes you need to by following the exact syntax of the command at the command line for changing options. AutoLISP new MLEADER commands This macro works, but it has its limits. After you run it, CANNOSCALE and CMLEADERSTYLE may both have new values, and the next time you place a Multileader the content will be placed first, not the arrowhead as would normally be the case. Let's use basic AutoLISP to correct those problems. Start with an error handler. The new command definition starts storing the existing error handler, CANNOSCALE, and CMLEADERSTYLE by binding them to variables. Then the new error handler, CANNOSCALE, and CMLEADERSTYLE are made current. Once the MLEADER command completes, it is repeated with arrow head first as the option. Then the program cancels MLEADER and restores the original settings. AutoLISP MLEADER Styles MLEADER styles aren't available through the tblsearch function. Use the dictsearch function to list the styles in the ACAD_MLEADERSTYLE dictionary or the assoc codes of a specific style. This is a partial group-code description of the MLEADER style "AU." To decipher the group codes, you'll need a reference. Get it here: images.autodesk.com/ adsk/files/ acad_dxf0.pdf.

Take Me to Your Multileaders

page 22

VLISP MLEADER Style To use VLISP rather than straight LISP to manipulate MLEADER styles, you'll need to get a properties dump. Use the following syntax.

A long list of properties will result. A partial list appears here:


; IAcadMLeaderStyle: AutoCAD MLeaderStyle Interface ; Property values: ; AlignSpace = 0.18 ; Annotative = -1 ; Application (RO) = #<VLA-OBJECT IAcadApplication 00d74d3c> ; ArrowSize = 3.0

MLEADER C#.Net & VBA APIs There are two obvious problems with MLEADERS that could be addressed through programming: converting existing LEADERS into a new MLEADER object, and converting the proxy-object that is created when an earlier release of AutoCAD is used to open a drawing in which an annotative MLEADER has been placed. The first turns out to be possible, but not as easy as you might think. The second may not be possible at this point. Converting LEADERS to MLEADERS. Because of an anomaly in the API that defines MLEADERS, it's tricky to get an exact duplicate of an existing LEADER because the location of the landing is not consistent. This is because the final X coordinate of the mleader needs to be adjusted by a combination of the width of the annotation entity, and the current mleader styles landing gap and dogleg length - to be in the proper location. This is different depending on which side the annotation is on left or right and which API we are using. If we use the final x coordinate of the leader entity without this adjustment - the dogleg of the mleader entity will be shifted left or right depending on the direction of the annotation. This solution is well documented in the code samples for C#.Net and VBA. As indicated earlier, multiple sample solutions to this problem will be placed on AU Online that were written by my colleague Paul Richardson. Converting proxy MLEADERS to LEADERS. You can explode an MLEADER in AutoCAD 2008 and get polylines, text, and solids (for the arrowhead the old AutoCAD solid, not a 3D solid). If will get the same results in earlier releases if the MLEADER has not been used with annotative scales. Otherwise you'll get a proxy object that explodes to an AcDbZombieEntity.

Вам также может понравиться