Page 1 of 1

Layers and blocks trouble

Posted: Tue Jul 15, 2014 11:16 pm
by kazmer
I am not sure if this is a "How Do I" or "Troubleshooting", but I guess it'll be this one :)

Community Git (at about 9f0550) as well as 3.6.0, on Linux.

See attached drawing: it has a layer named "ALayer" as well as Layer 0. It also has a square block that is drawn on Layer 0, with color "By block".

The square block is inserted into ALayer, and a circle is also drawn on ALayer. The circle is not a block or anything, just a plain circle drawn.

Now let's toggle layer visibility.
  • If I turn off Layer 0 visibility leaving only ALayer visible, the square disappears. I would expect it to stay.
  • If I turn off ALayer visibility leaving Layer 0 visible, both the square and the circle disappear. This is expected.
  • If I turn off both layers, both objects disappear, and both objects appear when both layers are set to visible. This is also as expected.
It is sort of as if the block was both on the layer it was inserted into as well as the layer it was drawn onto.

I am pretty sure I am having a misunderstanding of some fundamental concept, but I can not seem to be able to figure out what.

Cluestick, please? :)

Re: Layers and blocks trouble

Posted: Wed Jul 16, 2014 9:46 am
by Clive
kazmer wrote:It is sort of as if the block was both on the layer it was inserted into as well as the layer it was drawn onto.
Yes the original block reference source was created on layer 0, it doesn't matter where else you insert a copy of your block your original block reference will always be anchored down to that first place where you created it ... unless you edit the original reference.

Lets do a little exercise to try and understand things a bit better:

1.Using your file, create a new layer, lets name it 'New Layer' with its colour set to Green.
2.Now lets edit the original block reference, double click it or from main menu > Block > Edit Block from Reference.
3.Select the entities that make up the block and in the property editor change the layer to 'New Layer' and the colour to 'By Layer' (Green).
4.Now double click Model Space in the block list to get back to our main drawing area.
5.Toggle the visibility of layer 0, you will see it has no effect, there is nothing on it now. Toggle the visibility of our 'New Layer' (in Green) and you will see that your original Ablock disappears, we have moved the Block reference.
Block Reference.png
Block Reference.png (7.65 KiB) Viewed 8127 times
I hope this will help you to understand what is happening here.

@Andrew, please chip in if needed.

Re: Layers and blocks trouble

Posted: Wed Jul 16, 2014 10:09 am
by andrew
The essential thing to remember is that each block reference is an entity and resides on a layer.
Each entity that is part of the block definition is also on a layer.

There's also an FAQ entry about this common problem:
http://qcad.org/en/qcad-documentation/faq#q26

Re: Layers and blocks trouble

Posted: Sun Aug 10, 2014 7:42 pm
by 0xdeadbeef
I understand that this is by design and I'm sure there are reasons for this, but it's just that this feature costs me a lot of time and nerves.

So let's assume I have a group of objects that I need on different layers (in my case representing acrylic glass cutouts on different physical layers). These objects are constructed from arcs, lines etc. so I want to group them to blocks since only then I can define a permanent reference position to move them around, copy them easily etc.

Now I want to copy this group to another layer at the very same position. When I just select the objects manually each time (which by itself is quite annoying and error prone for larger selections), they will get a temporary reference position which makes it impossible to place the group exactly at the same position where it was in the original layer. This is perfectly possible though when I convert the selection to a block before. But due to the nature of the block implementation, the copied group will not be moved to the layer where I moved the copied block. Which might be intended, but it's also very frustrating as it seems to make it impossible to do what I intend to do. If there was another (permanent) grouping that worked as expected, I would happily use that and let the blocks be blocks.

SO, would it really be so horribly bad to implement a feature to allow to move/copy the contents of a block to another layer instead of just creating a reference?
Or is there already another way of grouping object that allows me to define a (permanent) reference position for the group and then move/copy the whole group to other layers?

Re: Layers and blocks trouble

Posted: Sun Aug 10, 2014 8:34 pm
by Husky
0xdeadbeef wrote:Or is there already another way of grouping object that allows me to define a (permanent) reference position for the group and then move/copy the whole group to other layers?
Ok, not the solution what you are asking for but my personal workaround in situation like this is:

> Selection of everything I need - Copy with reference (clipboard) - chosen reference = Absolute 0,0,
> Switch to the correct layer,
> Paste (Clipboard) / Option "To current layer" - Position = Absolute 0,0
> done ...

Re: Layers and blocks trouble

Posted: Mon Aug 11, 2014 6:28 pm
by 0xdeadbeef
Ok, this is a workaround indeed. Thanks for that.
Then again, I still need to select every single part of a complex object over and over again where what I just want to do is to create a group, define a fixed reference point and then copy and move the whole group to other layers.
To me this sounds like a natural thing to do, but yeah well :(