Theme and Variations: Dynamic Blocks

You can add variety to your blocks by making them dynamic. The two most useful applications for dynamic blocks are multiple presentations of similar objects and manipulation of components within individual block inserts.

AutoCAD's dynamic blocks feature gives a great deal of flexibility to block creation and insertion. But it's also a very complicated system, with its own set of commands and system variables. I recommend that you become very familiar with regular block creation and insertion techniques for creating and inserting blocks (which I describe in Chapter 17) before you tackle dynamic blocks.

image

Figure 18-3: Editing after the fact with the Array contextual Ribbon tab.

image Spend some time planning your dynamic blocks. Sketch out the geometry for each variation in appearance (or visibility state) and decide where the common base point should be. Unless you're a lot smarter than I am, you'll probably find that creating dynamic blocks is complex enough without trying to design your blocks as you go.

Now you see it …

If your drawing shows six different kinds of windows, one approach is to create six different standard blocks to represent them all. Alternatively, you can create a single dynamic block and define visibility states to cover all six different types. The following steps show you how to make your blocks do double (or sextuple?) duty by using the Edit Block Definition dialog box:

  1. Open a drawing that contains some block definitions you'd like to combine, or draw some simple geometry to make some similar types of objects.

    image You can find the files I use in this sequence of steps at this book's companion web site. Go to www.dummies.com/go/autocad2012 and download afd18.zip. The drawing named afd18b.dwg contains the three-piece furniture suite (see Figure 18-4) I use to create a dynamic block.

    You can create dynamic blocks from scratch, or you can work with existing standard (that is, non-dynamic) block definitions. Figure 18-4 shows a drawing with three non-dynamic blocks.

    image

    Figure 18-4: Three blocks to make three seats.

  2. image On the Block panel of the Home tab, choose Block Editor to open the Edit Block Definition dialog box.
  3. In the Block To Create Or Edit box, specify a new block name or select <Current Drawing> and then click OK to display the Block Editor window.

    The Block Editor is a special authoring environment with its own Ribbon tab plus a passel of command-line commands. You also have access to the rest of the Ribbon tabs, so you can draw and edit just like you would in the regular drawing window. The background color is different from the drawing editor's background color to help you remember where you are.

    The Block Editor tab's Geometric, Dimensional, and Manage panels (see Figure 18-5) are elements of AutoCAD's parametric drawing feature. (AutoCAD LT doesn't fully support parametric drawing, so LT's Block Editor lacks the Geometric and Dimensional panels and gets a mini-version of the Manage panel.) In this book, I don't have room to cover parametric constraints in dynamic blocks, but I do cover parametric drafting in Chapter 19. The concepts are pretty similar to adding parametric features to dynamic blocks.

    If you enter a new block name, AutoCAD displays an empty block-authoring environment where you draw geometry or insert existing blocks. If you instead select Current Drawing, AutoCAD places all drawing objects inside the block authoring environment.

  4. Create some geometry for the first visibility state. Alternatively, click the Home tab, choose Insert on the Block panel, and select an existing block definition to serve as the first visibility state.

    When creating geometry from scratch, pay attention to where the common base point should be. Although you use different blocks to assemble a multiple-view block, they should all have the same base point (0,0 is a good one for blocks). You don't want your chairs jumping around between different insertion points!

  5. If you inserted an existing block in Step 4, deselect all three Specify On-Screen check boxes, make sure that the Explode check box is not selected, and then click OK.
  6. Repeat Steps 4 and 5, drawing or inserting all the necessary geometry.

    At this point, your drawing screen may look pretty strange (see Figure 18-5). Don't worry; you're going to fix it up in the next steps.

    image

    Figure 18-5: Three seats in the Block Editor.

  7. Click the Parameters tab of the Block Authoring Palettes and then click Visibility (refer to Figure 18-5).

    If the palettes aren't open, click Authoring Palettes on the Manage panel on the highlighted Block Editor contextual tab of the Ribbon.

    AutoCAD prompts you to specify the parameter location.

  8. Click to place the parameter marker somewhere other than the base point location you chose in Step 4.

    AutoCAD places a parameter marker at the selected point and returns to the command line. As shown in Figure 18-5, the label Visibility1 appears next to the Visibility Parameter marker, and a yellow Alert symbol indicates that no action has been assigned to the parameter yet. The controls on the Ribbon's Visibility panel become active.

    image The parameter location you specify will be the spot on the block where the dynamic block option grip will be displayed. It's not crucial where you locate this point, but try to pick a sensible location on the object. If you specify the same point for the parameter location as the base point for the block, you may have a hard time selecting the dynamic option grip.

  9. Click Visibility States on the Visibility panel. Click Rename and change VisibilityState0 to something more descriptive. Click OK.

    As is the case with other named objects in AutoCAD, it's good procedure to assign useful, descriptive names rather than accept the default generic labels.

  10. On the Visibility panel, click the Make Invisible button. At the Select Objects prompt, select the geometry or block inserts that should be invisible in the current visibility state — that is, those that are not associated with the current visibility state — and then press Enter.

    AutoCAD prompts:

    Hide for current state or all visibility states [Current/
             All] <Current>: C
  11. Click Visibility States again and then click New to create a new visibility state. In the New Visibility State dialog box, enter a descriptive name. Select the Show All Existing Objects in New State radio button and then click OK.

    All your geometry should reappear.

  12. Repeat Steps 9 and 10 to create additional visibility states associated with the remaining geometry or blocks.

    The geometry or block insert associated with the last-created visibility state should be visible on-screen.

  13. Click OK to close the Visibility States dialog box, then click Close Block Editor on the Ribbon. Save the changes to your new block or to <Current Drawing>.

    AutoCAD displays an alert box asking if you want to save changes to your block. Click Cancel to return to the block editor or Discard the Changes to close the Block Editor without saving your changes. Click Save the Changes to update the block and exit. AutoCAD closes the block authoring environment and returns to the standard drawing editor window.

image AutoCAD 2012's Block Editor tab includes a Test Block tool that lets you see what your finished product will look like without the hassle of closing the editor and inserting or manipulating the block inside the drawing editor. Test Block displays the geometry and lets you try different parameters; then easily return to the Block Editor to tweak your masterpiece. You'll find the Test Block button on the Open/Save panel of the Block Editor contextual tab.

Lights! Parameters!! Actions!!!

You can modify the appearance of individual instances of the same block by defining parameters and actions to move, rotate, flip, or align parts of them. You can adjust the block's appearance as you insert it or at any time afterward. The following steps show you how to use the Block Editor to add some action to a block definition:

  1. Open a drawing that contains some block definitions whose appearance you'd like to spice up a little, or draw some simple geometry that might make a suitably dynamic block.

    Action parameters are most effective in block definitions that contain groups of related objects — for example, an office desk and chair or a furniture arrangement.

  2. On the Block panel of the Ribbon's Home tab, choose Block Editor to open the Edit Block Definition dialog box.
  3. In the Block To Create Or Edit box, type a new block name or select <Current Drawing>, and then click OK.
  4. Create some geometry or insert some blocks. When you insert blocks, remember to make sure that the Explode check box at the lower-left corner of the Insert dialog box is not selected, and then click OK.

    Draw the geometry or insert the blocks in a group such that you can insert the finished arrangement into your drawings — for example, Figure 18-6 shows the creation of a dynamic block for a coffee shop or cafeteria.

  5. Repeat Step 4 until you've drawn all the needed geometry or inserted all the necessary blocks.
  6. Click the Parameters tab of the Block Authoring Palettes and then click Rotation Parameter.

    AutoCAD prompts you to specify the parameter location.

  7. Click to place the parameter marker somewhere on the object geometry other than the base-point location.

    If you specify the same point for the parameter location as the base point for the block, you may have a hard time selecting the dynamic option grip.

  8. AutoCAD places a parameter marker at the selected point and returns to the command line, prompting you to specify the radius of the rotation parameter and the default rotation angle.

    The parameter marker's label appears next to the rotation parameter marker.

  9. Click the Actions tab of the Block Authoring Palettes and then click Rotate Action. Select the Rotate Parameter, select the objects that should be modified when the grip is used, and specify a point for the action's label.

    AutoCAD returns to the command prompt. At this point, it's fine to go with default values and on-screen pick points.

  10. Repeat Steps 6 through 9, trying different parameters and actions.

    For example, choose a Point Parameter and a Move Action.

    Figure 18-6 shows a set of block components, several of which have action parameters assigned to them. After the block is inserted, you can manipulate the components to which you've added parameters to vary the appearance of the blocks. I explain how a little later in this chapter.

    image

    Figure 18-6: A passel of parameters ready for action.

  11. Click Close Block Editor on the Ribbon and save or discard your changes.

    AutoCAD closes the block-authoring environment and returns to the standard drawing editor window.

Manipulating dynamic blocks

After a dynamic block has been inserted in a drawing, you can select it and modify its display through a special set of custom grips. (That's what AutoCAD calls them, so I'm following suit.)

image When you select a non-dynamic block, you see a single grip at the insertion point. When you select a dynamic block, you see at least two — and maybe more — custom grips, as well as the insertion point grip. The custom grips usually look different from the regular object grips, but not always, so take care while clicking grips.

The following steps show you how to make your dynamic blocks do the things you just spent all this time teaching them to do:

  1. Insert a few blocks that contain some dynamic parameters, such as visibility or action parameters.

    If your block inserts don't have any action parameters, go to Step 4.

  2. Select a block that includes some action parameters.

    The block insert displays a number of grips (see Figure 18-7). If the insert displays only a single square grip, it isn't a dynamic block.

    image

    Figure 18-7: Variations on dynamic blocks (original on the right, and a handy grip tip on a chair at left center).

  3. Click one of the custom grips — for example, clicking a round grip opens the rotation parameter of the object. Rotate the component as required.
  4. Select a block that includes a visibility parameter and then click the visibility grip. Choose the desired visibility state from the right-click menu.

    For additional information on manipulating actions and visibility states, look up Dynamic Blocks in the online help system.

Dynamic blocks, as I've suggested more than once, are a powerful — and complicated — feature. Prior to AutoCAD 2010, the Block Authoring Palettes contained 10 selectable parameters, 8 actions, and 20 parameter sets. AutoCAD 2010 added 12 geometric constraints and 6 dimensional constraints. I'm thinking of writing a new book called AutoCAD Block Authoring For Dummies (although, truth be told, it may never happen). Until I do, AutoCAD's online help system is your best resource for more information on all the possibilities of dynamic blocks. The quickest and most direct way to AutoCAD's own help on the subject is to type Dynamic Blocks into the Search box on the program title bar.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset