Blocs and layers

Use this forum to ask questions about how to do things in the QCAD Community Edition.

Moderator: andrew

erisian
Newbie Member
Posts: 4
Joined: Thu Nov 06, 2008 2:03 pm
Location: KHIE

Use of Blocks

Post by erisian » Thu Nov 06, 2008 3:42 pm

Here's the problem I'm seeing with the use of blocks:
I have a multilayer drawing of an assembly in which each layer represents one part of the assembly.
I want to use arrays of blocks on several layers, independently.
The blocks are all confined to a single layer, in other words, there are no multilayered blocks.
Under the current system, I can not have the blocks on the individual layers visible without having a "master layer" containing the master instances of the blocks also visible. The only solution that I can see is to create a separate, duplicate master block for each layer. This largely eliminates the advantage of using blocks, since then there is no longer a single master block for the entire drawing. It also largely eliminates the advantage of the arrays, since the master block for each layer must be in that layer, and hence not part of any array, unless duplicates are allowed, which is not only bad practice, but is forbidden in my application.
Am I missing something?

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Use of Blocks

Post by andrew » Thu Nov 06, 2008 4:03 pm

erisian wrote:I have a multilayer drawing of an assembly in which each layer represents one part of the assembly.
Please note that layers are intended for elements with a similar 'function' and with identical attributes (e.g. all invisible edges are on a layer, all center lines are on a layer, all exterior walls of a floorplan are on one layer, etc.).

Layers are not suitable for any kind of logical grouping. All elements that form a mechanical part or an assembly group might be grouped in one block, but should not be put on one layer. Layers and groups are different concepts and not interchangeable.

If you have the book "QCAD - An Introduction to Computer-Aided Design", please refer to the chapter about layers for details.

erisian
Newbie Member
Posts: 4
Joined: Thu Nov 06, 2008 2:03 pm
Location: KHIE

Post by erisian » Thu Nov 06, 2008 8:37 pm

While I certainly agree that
Layers and groups are different concepts and not interchangeable.
I disagree that I should not use a layer to group the elements of a part, and so does cadtutor.com
Basically, layers are the computer equivalent of tracing overlays on a drawing board.
And:
For example, if you were creating a landscape masterplan, you may have layers called "Trees", "Shrubs", "Path" etc.
Daily Autocad Agrees:
Let us start with the definition of LAYER. Think about layers in AutoCAD in that way: You are drawing in a traditional way. You draw walls on an acetate, doors on another one and likewise all parts of the drawing on a seperate acetate. Placing them one on the top of the other, you see the whole drawing. If you do not want to see the doors, you can just take the relevant acetate out. That’s exactly what ‘layer management’ does.
Layers are for grouping objects by any arbitrary criteria. Blocks are for the creation of reuseable objects, which is not what I am trying to do. The part may be made largely of blocks, but the part itself should be a layer and not a block of blocks. Blocks are also unsuitable for grouping the elements of a part in my drawing because once the block is created, the block is not editable in the context of the drawing. It is editable in the block editing window, which has none of the drawing layout available to it, or in the main drawing only if it is exploded. But then the block would need to be recreated to control visibility. This is not an efficient process. Further, the issues with arrays of blocks mentioned in my previous post would still remain.

Just as the color, linetype, and linewidth can be set by either the first instance of a block or by the layer where another instance is placed, the visibility of other instances should be independent of the visibility of the first instance. Then a layer could be created for the first instances, with their color, linetype, linewidth, and visibility set to By Block. This layer could then be set invisible without setting all instances of the block invisible.
Last edited by erisian on Thu Nov 06, 2008 9:21 pm, edited 1 time in total.

rwells
Junior Member
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Post by rwells » Thu Nov 06, 2008 8:39 pm

I also have problems with blocks in QCad. This is mostly because they are apparently handled very differently than in AutoCad and my drawings must be manipulated in both environments. The way I see it, in AutoCad a block is an attribute, resource if you will, of the drawing and exists only as a definition until one is created. An instance of the block does not exist until it is created (inserted) on a particular layer where its display attributes may be manipulated as any other item on that layer. In QCad the block does exist on the layer where it is defined/created as well as on any layers where it may be inserted. This seems to have the effect that I can not change display attributes, e.g. color, on the layer where it is inserted. I have to change the color on the layer where it is defined. This means that I have not been able to have an instance of a block on two different layers and each have a unique color.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Post by andrew » Thu Nov 06, 2008 9:04 pm

First, please note that there is a difference between a "block definition" (or "block") and a "block insert" (or "insert"). I am aware that most AutoCAD literature does not make that separation, yet I think it is essential to understand blocks.
rwells wrote:I also have problems with blocks in QCad. This is mostly because they are apparently handled very differently than in AutoCad
This should definitely not be the case, although the user interface might be different.

To have a block insert on multiple layers with the attributes of the layer, use the pen "By Layer" to create the entities of the block definition.

Those entities inside a block definition that are created with attributes set to "By Block" will inherit their attributes from the block insert. If the attributes of the block insert are set to "By Layer" (default), the entities inherit their attributes from the layer on which the block insert is created.
rwells wrote:In QCad the block does exist on the layer where it is defined/created as well as on any layers where it may be inserted.
No, a block does not exist on a layer. But the entities that are part of the block definition exist on a layer.

This is indeed an important feature. For example a block containing a screw may have a line on layer "center lines" and other lines on layer "visible", just as an example. The block may be inserted on various layers, for example on layer "details" and on layer "screws" or whatever.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Post by andrew » Thu Nov 06, 2008 9:20 pm

erisian wrote:While I certainly agree that
Layers and groups are different concepts and not interchangeable.
I disagree that I should not use a layer to group the elements of a part, and so does cadtutor.com
I couldn't find anything on that page that says you should use layers to create groups of entities, but maybe I am overlooking something.
erisian wrote:
Basically, layers are the computer equivalent of tracing overlays on a drawing board.
Yes. And these overlays contain elements with similar functions. For example all furniture is on one layer, all walls on one layer, etc. Layers are NOT used to group all elements of one particular piece of furniture (or all elements of an assembly group).
erisian wrote: And:
For example, if you were creating a landscape masterplan, you may have layers called "Trees", "Shrubs", "Path" etc.
Agreed (see above). Note that "Path" will be used for all paths of the drawing, not one particular path, so I would probably name it "Paths", but that is a detail. The definition from Autocad daily seems also right, no objections here.
erisian wrote: Layers are for grouping objects by any arbitrary criteria.
That I would categorize as an abuse of layers. As soon as you start using layers for grouping you will run in all sorts of problems. Mainly because one entity is always on exactly one layer.

Let's say you put a whole room of a floorplan on one layer "room1". The walls of that room are then no longer on layer "walls" as they should be. The furniture of that room is no longer on layer "furniture", etc. All entities on your "room1" layer will also have the same attributes, unless you assign fixed attributes to them which is a bad idea.

erisian
Newbie Member
Posts: 4
Joined: Thu Nov 06, 2008 2:03 pm
Location: KHIE

Post by erisian » Thu Nov 06, 2008 10:14 pm

Layers are for grouping. Perhaps there is a better term. In your example, all the walls are grouped on layer walls, etc. The grouping is arbitrary. Layer walls could be broken into layer studs and layer drywall, for example. That would not be conventional, but the conventional way is also arbitrary.

So for my assembly, I choose to organize the master drawing into layers, each of which represents a specific single piece of material. There are design elements which are used on more than one piece, therefore in the drawing there are blocks which are used on more than one layer. It would therefore be useful to be able to control the visibility of the block inserts independently of the visibility of the block definition.

As it is now, it is impossible to have the block inserts visible while the block definition is invisible.

erisian
Newbie Member
Posts: 4
Joined: Thu Nov 06, 2008 2:03 pm
Location: KHIE

Block Snap Bug

Post by erisian » Fri Nov 07, 2008 1:49 pm

The snaps run to points on atomic entities inside blocks on invisible layers, if the layer with the block definitions is set visible.

rwells
Junior Member
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Post by rwells » Fri Nov 07, 2008 5:53 pm

"As it is now, it is impossible to have the block inserts visible while the block definition is invisible."

One of my points well.

rwells
Junior Member
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Post by rwells » Fri Nov 07, 2008 6:07 pm

"No, a block does not exist on a layer. But the entities that are part of the block definition exist on a layer. "

This may be true of the drawing on which the block is created. In AutoCad, however, it is not apparently true if that block is inserted into another drawing. In the second drawing there is no evidence of the individual entities that make up the block. In QCad this seems different. Drawings (DXF) that I create for AutoCad do not have the individual entities that are in a block anywhere. The same DXF in QCad exhibits these block related problems that are being discussed here. Therefore, I submit, QCad and AutoCad handle blocks differently.

Locked

Return to “QCAD Community 'How Do I' Questions”