Evilham

Evilham.com

AutoCAD: Blocks. Part I: Basics

Introduction

If you’re a somewhat advanced AutoCAD user, you probably fully understand blocks and its usage. If that’s the case, you probably should skip to the next part of the series on blocks.

Basically, a block is a way of grouping objects (e.g. lines, texts, circles, other blocks, etc.), giving such group a name and it allows for easy manipulation of a big amount of objects.

On this part, we’ll see some advantages of using blocks and lastly but more importantly: block attributes.

Table of Contents

Advantages

Use of blocks has several advantages, here are some I came up with:

Smaller file size

The block definition is saved just once and every graphic instance of a block (called block reference) consists only of basic properties like: block name, insertion point, scale (x,y,z) and rotation (plus, the general graphic object properties). That means that when a block is used several times, less information has to be stored in the file.

Instant update of symbols

Again, because the block definition is saved just once, if you need to modify a symbol you have used a hundred times, you need only to modify the block definition in order to reflect those changes consistently and instantly across the drawing.

Conceptual and graphic separation

If a drawing is complex and layers are not enough for conceptual separation, it may be useful to create blocks for things that represent different parts of the same object. Done correctly, it can avoid confusion and create a better workflow.

Block Attributes

What are attributes?

Attributes are a way of having some text associated with a block, the beautiful thing of attributes is that, unlike the other parts of a block (excluding dynamic blocks), they can change from one block reference to another.

These attributes may or may not be visible, constant, you can change their position, even change their aspect for each block reference, they are quite flexible.

Example

Consider a valve and its TAG number, it may be desirable to use a block for the symbol but texts are something static that looks exactly the same in all of the instances. One solution could be to use a different block for each tag, but that’d defeat the point of using blocks. Here is where attributes come handy, we just add one to the block definition, place it where we want it, insert it and change the text at will.

valves

The catch

The flexibility of attributes comes with a cost, since you are able to relocate them, change their colour, text style, angle, alignment, etc. for each block reference, there’s a bit of a disconnection between the block definition and the block reference when it comes to attributes.

For instance, say you define a block valve without the tag attribute, make a couple insertions of the block and then realise you need that tag attribute. So you go to the block definition, add it and save the definition.

What happens to the existing block references? Absolutely nothing, they won’t have your tag attribute. Similarly, relocating an attribute or changing its aspect won’t affect the existing block references. Instead, all of the new ones will be exactly as the block definition.

There’s a way to force a global update of a particular attribute natively with AutoCAD, it’s under: Modify / Object / Attribute / Block Attribute Manager. The downside is that it will reset all of the properties for a given attribute, that is, if you relocated the attribute in a cluttered zone so that it’s visible, it’ll go back to the default position and overlap with something else, so be careful!

You could, of course, write your own Lisp routines to update just a given property like colour or layer.

Closing

In a few follow up posts, I’ll cover how to create and modify blocks, how to insert them from an existing file, how to access and modify its attributes, and a few other things, all with lisp scripting. Stay tuned.