Chapter 5 - Grouping Entities In Autocad
This final chapter of the notes on AutoCAD deals with the methods of grouping objects in a drawing, both in the form of layers and as blocks. 
Layering
The concept of layering was discussed in some detail in Chapter 5 of these notes. The AutoCAD extension package that will be used in this subject provides extensive facilities to aid in the use and management of layers. Therefore, this section need only introduce the basic commands that are used to define and select layers. 
Layer 
This command supports the following operations. 
      Description of Operation                   Option Keyword
      obtain a list of existing layers           ?
      create new layers                          New
      select the current layer                   Set
      create a new layer and make it current     Make
      set the colour for a specific layer        Colour
      set the line type for a specific layer     Ltype
      freeze or thaw a layer                     Freeze/Thaw
      make a layer visible or invisible          ON/OFF


Ddlmodes

This command performs the same function as the LAYER command just described except that it does it in a much more convenient fashion by making use of a pop-up dialogue box on the screen. This dialogue box also allows you to rename a layer which is not possible with he older, LAYER command. This command (since it has such an obscure name!!) is best called up by picking "Modify Layer..." from the Settings pull-down menu. 
The colour and line style of entities drawn with AutoCAD are generally determined by the layer on which those objects reside. However, it is possible to override this by specifically defining these attributes for the objects in the drawing. This is done using the COLOR and LINETYPE commands. These commands are not discussed further in these notes, as it is unwise to mix the two methods of determining these attributes. Also note that the colour of an entity is used to determine which pen will be used when the drawing is plotted. This means that part of the function of layers can be to determine which pen is used for drawing on a multi-pen plotter. 

Another important facility that is offered by AutoCAD is the opportunity to freeze and / or thaw layers on a per viewport basis when working in paper space with TILEMODE "off". This is achieved using the VPLAYER command. This facility allows you to have the same view of a drawing model in two viewports, where each displays a different set of layers. This is crucial if a single drawing is to contain, say, a reflected ceiling plan and a furniture layout plan of the same part of the model. 

 
Vplayer 
This command allows you to freeze and thaw layers in selected viewports. It will only operate if TILEMODE is set to 0 ("off"). Options associated with this command allow you to: list all layers that are frozen in a particular viewport; create layers which are frozen in all viewports; tag existing layers so that they are automatically frozen in any new viewports that are created; and reset selected layers in selected viewports back to their default state. 
Blocks
Blocks in AutoCAD are used to group entities together so that they can be manipulated as a single unit. This concept should not be confused with the notion of selecting groups of objects and transforming or copying them as described in Chapter 8 of these notes. The use of blocks is best understood by considering the commands that are used to manipulate them. 
 
Block 
This command is used to create new blocks from parts of an existing drawing or to list all the defined blocks associated with the current drawing (option ?). If creating a new block, AutoCAD prompts first for a name which can be up to 31 characters long, constructed from letters, digits and special characters ("$ - _"). It then asks for an insertion base point which becomes the "anchor point" of the block for future manipulation. Finally, the user is prompted to select the objects to be included in the block using the normal methods. Once created, the graphics comprising the block is erased from the drawing (if desired, this can be restored using the OOPS command without affecting the block definition). The block can then be inserted anywhere using the INSERT command. 

Wblock
This command is used to store a defined block from the current drawing on a disk file so that it can be used by another drawing. AutoCAD prompts first for a file name. It then asks for a block name. Valid responses are: a name entered on the keyboard; the character "=" denoting "same as file name"; "*" denoting "entire drawing"; or RETURN denoting a wish to select the objects in the normal fashion. If the entire drawing is to be saved as a block, then the BASE command should be used to set the base insertion point. If this command is not used, then the insertion point is assumed to be (0,0). 

Insert
This command inserts a previously defined block into the current drawing or lists available blocks (option ?). If a specified block name is not on the list of available blocks for that drawing, then AutoCAD searches the disk for a file with the same name and, if found, loads that in as a new block before proceeding with the insert operation. Once a block has been found, AutoCAD supervises its insertion into the drawing. Options available include: X and Y scaling, rotation, fitting to a specified rectangle (if the block is defined in terms of a 1 x 1 box) and dragging. 

 

 

A special case of the INSERT command is activated if the block name specified is preceded by an asterisk (*). This causes the block to be inserted as a single unit (using all the same insertion options) and then broken up into its separate graphic entities. These then lose their block characteristics and become like any other graphic entity. 

Another special case is where a block has been defined from an external file, and that file has been subsequently changed. Those changes will not be automatically reflected in the block associated with the current drawing. To update the block definition in the current drawing, simply specify the block name for the INSERT command in the form "block name=file name" (or simply "name=" if the file name is the same as the block name). AutoCAD will then update the internal description of the block and regenerate the drawing to reflect those changes.

Explode

This command can be used to break up an existing instance of a block into its component graphic entities. These then lose their block characteristics and become like any other graphic entities. If a simple polyline entity is "exploded" (where it is not part of a block), then it breaks up into separate line and arc entities (and loses its thickness characteristics). 

Minsert
This command is used to insert multiple instances of a block on a specified rectangular grid. 
External Reference Blocks
The insertion of an external drawing into another drawing, as described above, only creates a copy of that external drawing. A more powerful concept involves attaching that external drawing to the current drawing with a live link so that each time the current drawing is edited, the attached drawing is re-inserted. This arrangement can be achieved using the XREF command. Once the link is established, the external drawing is treated internally as a block. You can include multiple instances of that block with very little space penalty (in fact, the whole external drawing takes up little space in the local drawing). Although you cannot change the external block, you can access its parts. For example, you can snap onto entities in the drawing and you can temporarily change the visibility of its layers (layer changes are lost when the block is reloaded). 
 
Xref 
This command is used to manipulate external references. It allows you to: attach and detach external references; bind an external reference (which means severing the external link and making it a permanent block in the local drawing); relink an external reference whose path or name in the local file system has been altered (using the path option); or force an immediate reload of an external reference file. 

Xbind
This command allows you to bind some of the properties of an external reference file into your local drawing so that they are not updated, but become a permanent part of your drawing. You would use this if you wish to create a copy of a block or layer definition that is part of an external reference file.