Moving a block between Layers - bug or feature?

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
TerraD
Newbie Member
Posts: 6
Joined: Mon Feb 14, 2011 11:23 pm

Moving a block between Layers - bug or feature?

Post by TerraD » Mon Jul 16, 2012 2:26 pm

Not sure if I this is a bug or a feature. I used V3 RC5 for this.

A block created in a layer
- will keep the layercolor if copied or moved to an other layer even if property color is set to 'By Layer'
- will be subject to the invisible property of the layer its was created in and the layer it was copied to
Is such behavior features or bugs?

Steps to reproduce:
I created a layer 'Hilfekonstruktion' and set the layer color to yellow.
- designed in this layer a rectangle consisting of 4 lines.
- as I needed several copies of it I decided to join them in a block.
- the lines color was set to 'By Layer'
Created two more layers. 'Varainte 1' color green and 'Varainte 2' color light blue.
Copied the block (with reference) in layer 'Hilfskonstruktion' and pasted it in Layer 'Varainte 1'
- was astonished to see block in yellow
Cut the block (with reference) in layer 'Hilfskonstruktion' and pasted it in Layer 'Varainte 2'
- again did see it in yellow.
First I thought, the blocks had not been moved to 'Varainte 1' and 'Varainte 2'. But now I do have the following behavior. But if I hide the layers in 'Layer List' I get the following behavior:
- if I set 'Hilfskonstruktion' to invisible all blocks disappear. So I set 'Hilfskonstruktion' back to visible
- if I set 'Varainte 1' to invisible the blocks in just this layer disappear
- if I set 'Varainte 2' to invisible the blocks in just this layer disappear

Further:
I then saved the file. When I reopened it the blocks still showed the same behavior. And there was even an additional Layer named 'Defpoints'! I'm pretty sure I did not create it...
Attachments
Plan 1.dxf
(56.34 KiB) Downloaded 434 times

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

Re: Moving a block between Layers - bug or feature?

Post by andrew » Mon Jul 16, 2012 3:28 pm

First some necessary definitions:
- A block is the definition of a block (= a named group)
- A block reference is constructed when inserting a block.
TerraD wrote:A block created in a layer
- will keep the layercolor if copied or moved to an other layer even if property color is set to 'By Layer'
- will be subject to the invisible property of the layer its was created in and the layer it was copied to
This is a very common misunderstanding of the underlying CAD data structure.

- Each entity (line, arc, etc.) is on exactly one layer. This is also true for entities that are part of a block definition.
- Each block reference is also an entity and as such is also on exactly one layer.

This is not only desired but essential for many applications (blocks and layers are different concepts - a block can be seen as a named group, a layer is NOT a group, it's an attribute of an entity).

If you want the color of an entity inside a block definition to be defined by the layer of the block reference, set the color of the entity to 'ByBlock' and the color of the block reference to 'ByLayer'.
TerraD wrote:Further:
I then saved the file. When I reopened it the blocks still showed the same behavior. And there was even an additional Layer named 'Defpoints'! I'm pretty sure I did not create it...
Defpoints is required by the DXF/DWG format under some circumstances. Other CAD applications such as Autocad require that layer. You can simply ignore it. If you delete it, it will be back after saving / reopening.

TerraD
Newbie Member
Posts: 6
Joined: Mon Feb 14, 2011 11:23 pm

Re: Moving a block between Layers - bug or feature?

Post by TerraD » Mon Jul 16, 2012 4:38 pm

If you want the color of an entity inside a block definition to be defined by the layer of the block reference, set the color of the entity to 'ByBlock' and the color of the block reference to 'ByLayer'.
Thank you. Got the idea!
Defpoints is required by the DXF/DWG format under some circumstances. Other CAD applications such as ...
Hmmm, should have searched wit google... Defpoints is not part of help nor of the V2.2 manual... Thank you for your support!

Post Reply

Return to “QCAD Troubleshooting and Problems”