Tutorial: 1.11 Blocks

Video Transcript

This QCAD tutorial introduces the concept of blocks.

In the context of CAD, Blocks are groups of entities.

Example drawing: park.dxf

We will learn how to create, edit and use blocks.

When working with blocks, we need the block list of QCAD.

If the block list is not yet displayed, we can show it using the appropriate button in the toolbar at the top right.

The block list is typically displayed at the right, together with the layer list.

Let's have a look at this example drawing of a park layout.

We first have a brief look at the layer list again, before we focus on the block list.

In the layer list, we can see the different layers that are used to organize this drawing.

All plants are on layer "Plants" and displayed in green.

The park benches and trash cans are on layer "Facilities" and the paths on layer "Paths".

A layer contains all entities with the same or a similar meaning or function.

Layers also control the attributes of the entities drawn on them, for example the color.

We already talked about layers in detail in a previous tutorial.

Blocks organize a drawing in a different way than layers.

A block typically contains all entities that belong to the same real world object.

For example, this drawing has a block named "Bench" that contains a top view of a park bench.

If we double-click on the block "Bench" or click in the column between the eye icon and the block name, we can display the contents of this block.

The block contains the top view of a park bench.

We can think of a block as a separate drawing that is stored in the same file as our main drawing.

In the same way, we can look at the block "Tree B" which contains the top view of a tree.

But where is now our main drawing of the park layout?

Our main drawing is actually also stored in a block.

Every drawing file contains a special block called "Model Space" or simply "Model".

This block contains our main drawing. This is the drawing that is shown initially when we load a file or start QCAD.

So to return to our main drawing, we simply edit the model space block, always shown at the top of the block list.

In our main drawing, we can see our park bench again in seven places.

These seven objects are called block references.

Each block reference shows the block it refers to.

A block reference can show a block at a different angle or scale.

The park benches have been arranged at different angles, but they all show the same block.

The drawing of the park bench seen when we edit the block is called the block or block definition.

When a block is inserted into the main drawing or another block, a block reference is created.

Block references are sometimes simply called "Blocks" but in this tutorial we will stick to the proper terms.

A block is like a separate drawing with a name.

The block list shows all block names and lets us switch between blocks.

A block reference is the object in our drawing that displays a block.

To learn how to create blocks from scratch, we start a new drawing.

We first create two layers we can use for our block contents.

The layers in a drawing are the same for all blocks.

It does not matter which block we are editing while creating the layers.

The layers we are creating will be available to all the blocks in the drawing.

We now draw our block contents just as we normally would, in our main drawing.

For this example block, we draw a simple rectangle with rounded edges.

We add a center cross for our rectangle on layer "Center".

This will allow us to observe the effect of layers that are used in combination with blocks.

We now want to create a block based on our rectangle.

We select the entities which should be part of our new block.

To create a block, we use the tool to create a block from a selection.

This tool is located in the CAD toolbar at the left.

This tool will replace our selection with a block reference.

Since we don't want that block reference to be on layer "Center", we switch to layer "0".

We choose the reference point to use for our block at the center.

Finally, we have to give our block a name.

A meaningful block name will help us to later identify the desired block in the block list quickly.

The block has now been created and added to the block list.

At the same time, the selection in the drawing has been replaced by a reference to that block.

If we edit our new block, we can see that the block contains our rectangle and the center lines, just as expected.

The zero point of the block is at the center of the rectangle since this is the reference point we have chosen when creating the block.

We go back to the model space block.

Here, we want to add some more block references for our block.

We can also say that we insert the block into our drawing.

First, we click the name of the block we want to insert.

Then we click the button at the top of the block list to insert the block.

At this point, we should take a brief moment to consider on which layer we want to place our block references.

We have constructed our block in such a way that the color of the layer where we place the block reference has no effect.

However, we might still want to be able to switch on and off all inserted rectangles in our drawing.

We add a new layer called "Rectangles" that will contain all rectangles.

We make this layer yellow to demonstrate that the layer color does not affect our block references.

We can now place our block references in the drawing, on layer "Rectangles".

We can also insert the block at a different scale and rotation.

We right-click when we are done.

Note how our block references are not yellow even though we placed them on a yellow layer.

This is because the entities inside the block are on their own layer and take on the color of their respective layer instead.

Our center lines for example are still red, as they should be.

If we want to switch off all center lines, we can still do so.

As expected, this only switches off all center lines.

A center line is still a center line and on its appropriate layer, even if it is inside a block and the block reference is on a different layer.

If we switch off layer "Rectangles", all block references disappear, except for the initial one, which we have created on layer "0".

This also makes sense since the block references are regular entities that reside on a layer.

When we switch off layer "Rectangles", all entities on that layer are hidden, including all block references on that layer.

This effect might make it look like the center lines are now on two different layers: layer "Rectangles" and layer "Center".

Whenever we switch off either layer, the center lines disappear.

In truth, the center lines are on a single layer, layer "Center".

But when center lines are part of a block, the block reference that displays them are also on a layer.

When we switch off a layer with block references, all those block references are hidden, no matter what layers the entities inside the block are on.

The last thing we want to show in this tutorial is how editing a block affects existing block references.

We edit our rectangle block again.

This time, we add a circle at its center.

Now we switch back to the main drawing.

We can see that all block references have been updated accordingly.

A block reference shows the contents of a block and if the block changes, the block reference reflects this change immediately.

You should now have a basic idea of what blocks are, how they are used and how they can be created.

Keep in mind that there are more features of blocks that will be discussed in a later tutorial.

Be sure to practice the use of blocks with your own installation.

Thank you for watching this QCAD tutorial.