Sunday, June 26, 2011

Creating Dynamic Labels that function similar to Civil3D Labels and Multi-Leaders

Have you ever wanted to create custom labels that functioned similar to Civil3D Labels or Multi-Leaders, but worked with basic AutoCAD Objects? With Civil3D Labels being fully annotative smart objects, I've found that there is a large need to have similar labels for basic plan labeling. Multi-Leaders are great because they can be easily set to be annotative objects making them function similar to Civil3D objects -- but they limit the user on customizing. Sure they allow you to insert a block with a Multi-Leader, but they don't allow for attributed text or some of the other customizable items dynamic blocks are good for. Thus, a couple of years ago, I looked into ways of creating my labels as dynamic blocks and found that the possibilities are endless for customization. As of today, I've gone through and created the majority of labels used on plans with dynamic blocks and have sped up the process of labeling plan sheets tremendously.

Dynamic blocks allow you to control the appearance of a block - while the label block shown below may be showing pointing from the left side calling for R-3 RipRap, another block could be pointing from the right side calling out for R-5 RipRap as shown in the images below. Futhermore, each lable has a detail tag referring to a specific detail; each of these lables could be calling for a different detail on different pages if desired. Keep in mind these are the exact same blocks, but the block allows for these kinds of changes.





Basically what has been done to the block is Dynamic parameters have been applied. This block allows the user to switch the labels not only from R-3 and R-5 RipRap, but also to R-4, R-6, R-7, and custom text -- all completed through a visibility paramter. In the images below you will see the visibility parameter pull down on the left side of the label, a stretch and rotate parameter grip to the right of the detail tag, and a flip parameter grip at the tip of the leader. This allows the user to position the text portion of the label wherever they want, stretching and rotating the leader, as well as flipping the label to the oposite side to point from a different direction. I have also built in settings that restrict the user from creating leaders that point with an acute angle.





To set these blocks up, you first need a DimStyle that is Annotative and a 1"=1' text style that is not annotative. You create the leader with the basic leader command hitting escape before you are prompted for MTEXT or additional grips. The detail tag text is attribute text with locked position turned on, the other text is basic single line text, and the rest is basic linework.

Once the basic linework is started, begin with a visibility parameter. Setup the various menu items and copy/paste/change the text as desired. Turn on/off the objects in each of the visibility menus. One nice thing with the visibility parameter is when an attribute text object is placed on a specific visibility menu, the user is only allowed to fill in that attribute when that specific visibility menu is selected.

From here you have to setup a move action that is tied to a position parameter. The position parameter would go on the opposite end of the leader as the arrow, and the move action selects all objects and the visibility parameter EXCEPT the leader itself.

Next use a stretch parameter and action. Draw the stretch box around the visibility grip and all other text/label objects and be sure to cross the leader, but do not encompass the leader in it's entirety. Next apply the stretch action by selectin all objects including the leader and grips.

Next, add in the flip parameter. You will be prompted for a mirror line -- select the end point of the arrowhead and use ORTHO to draw a straight line up or down. Add ALL objects to the flip parameter. Be sure to select all of the objects on the visibility menus as well.

Last, while in Block Editor, go to the properties tab to list the properties of the block. Switch it to Annotative. This will allow the block to scale itself as the viewport or drawing scales change, making your custom label function just as a Civil3D Label or a Multi-Leader. Save the block and if done correctly, everything should work out as planned.

See the image below for where to place the Dynamic Block parameters and actions.

1 comment:

  1. Please, could you send me the .dwg file to study how to get this Dynamic Block done? I'm struggling to get it working properly. My e-mail is: lztoniolo@gmail.com

    Thanks!

    ReplyDelete