Moving a block between Layers - bug or feature?

If you are having problems with QCAD version 3, post here. Please report bugs here.

Moderator: andrew

Moving a block between Layers - bug or feature?

Postby 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 91 times
TerraD
Newbie Member
 
Posts: 4
Joined: Mon Feb 14, 2011 11:23 pm

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

Postby 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.
User avatar
andrew
Site Admin
 
Posts: 2383
Joined: Fri Mar 30, 2007 6:07 am

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

Postby 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!
TerraD
Newbie Member
 
Posts: 4
Joined: Mon Feb 14, 2011 11:23 pm


Return to QCAD 3 Troubleshooting and Problems

Who is online

Users browsing this forum: No registered users and 2 guests