Blocks: using Blocks on various Layers - possible?

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Helix
Newbie Member
Posts: 8
Joined: Thu Jun 11, 2015 8:41 am

Blocks: using Blocks on various Layers - possible?

Post by Helix » Mon Jun 20, 2016 3:06 pm

Hi. Novice question.... I'm drawing a garage building, with separate Layers for wooden 'Framework', 'Roof' and 'Brickwork'. I have created Blocks for one whole brick, a half-brick and a row of several bricks - these Blocks were created and inserted when the 'Brickwork' Layer was selected. I now need a second Layer depicting (different) brickwork, so I created an extra Layer entitled 'Bricks-side wall'. None of my Layers was created with a 'Parent' Layer.

I find I can insert a chosen (brick(s)) Block into the new 'Bricks-side wall' Layer - BUT if I turn visibility off for the 'Brickwork' Layer because I want to view only the 'Bricks-side wall' Layer, then the Block inserted into the latter disappears too. It seems that the Layer in which a Block was first created must be visible regardless of which other Layer it is inserted into - or am I misunderstanding something?

QCAD v 3.15.2 on Windows 10

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

Re: Blocks: using Blocks on various Layers - possible?

Post by andrew » Mon Jun 20, 2016 3:27 pm

Every entity is on a layer. When you insert a block, you are creating a block reference entity which itself is also on a layer. So you should check the layer of the lines inside your blocks as well as the layer assigned to the block references. One common way of dealing with this situation is to insert all block references to layer '0' and always leave that on.

Please refer to this forum thread in our tips and tutorials forum for an illustration:
http://www.qcad.org/rsforum/viewtopic.php?f=47&t=3121

Helix
Newbie Member
Posts: 8
Joined: Thu Jun 11, 2015 8:41 am

Re: Blocks: using Blocks on various Layers - possible?

Post by Helix » Mon Jun 20, 2016 3:57 pm

Andrew - thanks. Apologies, I don't fully understand your response though. This is probably because this is all very new to me and perhaps a bit of confusion between American and British English !

When you say: "check the layer of the lines inside your blocks as well as the layer assigned to the block references" do you mean that I should set the visibility to 'on' for both the Layer on which the Block was created AND the (separate) Layer onto which I've inserted it?

Your comment about Layer 0 also confuses me - do you mean I should create all Blocks on Layer 0 but with the items being 'blocked' resident on a different Layer? If so, would this require a practice of leaving Layer 0 completely blank but always visible - I think I can see how that would work, if I'm understanding this correctly.

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

Re: Blocks: using Blocks on various Layers - possible?

Post by andrew » Mon Jun 20, 2016 4:15 pm

Please consider the example block from http://www.qcad.org/rsforum/viewtopic.php?f=47&t=3121. The block contains various entities (=lines, circles, arcs, etc.), all on their individual layers ('0', 'red', 'blue'):
Screen Shot 2014-11-18 at 10.08.59.png
Screen Shot 2014-11-18 at 10.08.59.png (42.22 KiB) Viewed 17347 times
As soon as you insert this block into your drawing, you are creating a reference to that block, a so-called 'block reference'. This block reference itself is also on a layer: the layer that was active when inserting the block. Let's say you insert this block on a layer called 'green', thereby creating a block reference on layer 'green'.

Turning off layer 'green' will now hide your entire block reference even though the individual entities inside the block are on different layers ('0', 'red' and 'blue'). That's because the block reference resides on layer 'green' and turning off layer 'green' will naturally hide your block reference.

If you cannot solve it, please attach your original drawing file with an explanation of what you are trying to achieve, thanks.

Helix
Newbie Member
Posts: 8
Joined: Thu Jun 11, 2015 8:41 am

Re: Blocks: using Blocks on various Layers - possible?

Post by Helix » Mon Jun 20, 2016 5:46 pm

OK Andrew, I think I've got it now. The answer this has led me to is that I cannot have one Block for say, a brick shape, and use it in separate iterations on different Layers if I want to have visible only ONE of those Layers at any one time (unless the visible Layer contains both all the components that have been blocked together and the Block reference).

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

Re: Blocks: using Blocks on various Layers - possible?

Post by andrew » Mon Jun 20, 2016 7:17 pm

Helix wrote:The answer this has led me to is that I cannot have one Block for say, a brick shape, and use it in separate iterations on different Layers if I want to have visible only ONE of those Layers at any one time (unless the visible Layer contains both all the components that have been blocked together and the Block reference).
Unless I misunderstood what you are doing, I think you can:
- create the lines inside your block 'brick' on layer 'brick_outline'
- insert some block references of block 'brick' on layer 'exterior_walls'
- insert some block references of block 'brick' on layer 'interior_walls'

- switch on/off layer 'exterior_walls' to show/hide the bricks that make up exterior walls
- switch on/off layer 'interior_walls' to show/hide the bricks that make up interior walls
- leave layer 'brick_outline' on at all times

Helix
Newbie Member
Posts: 8
Joined: Thu Jun 11, 2015 8:41 am

Re: Blocks: using Blocks on various Layers - possible?

Post by Helix » Mon Jun 20, 2016 7:22 pm

Ah, OK - I'll give that a shot....

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: Blocks: using Blocks on various Layers - possible?

Post by J-J » Tue Jun 21, 2016 8:36 am

One procedure you can also try to comprehend the behavior:

1/ draw all the block shapes you want on layer 0 and use "create block from selection", assign names as required
2/ All your blocks now show in the block list
3/ From the block list, open the edit function for each block, you will now see only this block on the window
4/ select all lines in the block and within the property editor assign the parameter 'color' to 'by block
5/ right click the mouse in the window to return to main drawing
6/ repeat the same for each block
7/ when done, return to main drawing and delete all entities on layer 0, your block list will remain unaffected
8/ define your working layers with the parameters you want
9/ now, when you insert a copy of your blocks on the various layers, they will pick up the color of the layer
10/ you may now do as you please, showing or masking any layer and you won't be bothered with the initial copies used to define the blocks
JJ Win7 pro-64

Helix
Newbie Member
Posts: 8
Joined: Thu Jun 11, 2015 8:41 am

Re: Blocks: using Blocks on various Layers - possible?

Post by Helix » Tue Jun 21, 2016 8:48 am

OK, tried that. It works, provided I have separate items, one for each 'brick' Block, on the 'Outlines' Layer.

Thus I have a rectangle and a square on the 'Outlines' Layer, then an 'Exterior wall' Layer onto which I have set the Block reference for a Block called 'Brick - exterior' comprising the rectangle on the 'Outlines' Layer. Then the next Layer is 'Interior wall', on which I have inserted a Block reference called 'Block - interior' for the square item on 'Outlines'.

The result is that, provided the 'Outlines' Layer is visible at all times, I can have either the 'Exterior wall' or the 'Interior wall' Layer visible and see either the 'Brick' or the 'Block' respectively.

What I cannot do (and this is where my initial misundertanding was) is have a single entity as the component for two different Blocks created on different Layers. Once the first Block has been created, its components are not available for a second Block elsewhere unless the reference created by the first Block is also visible.

This is my understanding now, in my own words, of how it works. I hope this is correct because if so, I am making progress with my QCAD education!

Edit - this is in response to andrew's post on Monday. I didn't see J-J's post today until after I posted this! I'll try J-J's idea next!

Helix
Newbie Member
Posts: 8
Joined: Thu Jun 11, 2015 8:41 am

Re: Blocks: using Blocks on various Layers - possible?

Post by Helix » Tue Jun 21, 2016 11:00 am

OK, have now tried J-J's method, which is neat. I haven't yet come to an understanding of precisely how this works but I'm explaining it to myself along the lines of: 'once a Block has been created its identity and characteristics reside in the Block List rather than with the Layer on which the Block was created.' Hence it can be deleted from the 'creation Layer' without effect on the Block itself and the Block's characteristics can be edited subsequently via the Block List edit function, just as J-J described.

The Layer 0 (on which all Blocks were created then deleted) has to remain visible at all times for the Blocks to be visible so all items should be deleted from Layer 0 unless you require them to be visible at all times too.

Many thanks andrew and J-J for taking the time to post.

Post Reply

Return to “QCAD 'How Do I' Questions”