Blocks - How They Work?

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
User avatar
Chips&Chips
Full Member
Posts: 68
Joined: Mon Nov 13, 2023 12:15 pm

Blocks - How They Work?

Post by Chips&Chips » Wed Feb 28, 2024 1:20 pm

Every time I think I have a way to work with Blocks and Library Parts, I run into something else. I thought that by making sure that everything started on Layer 0 and was set to "By Layer" it was working out. But then I ran into this:

First I made absolutely sure there was only Layer 0 and no Blocks other than the mandatory two for every drawing. Everything was drawn on Layer 0. That includes the Block Attribute - I checked.
EverythingByLayer1.jpg
EverythingByLayer1.jpg (417.27 KiB) Viewed 471 times
Then I saved it as a Library Part.
EverythingByLayer2.jpg
EverythingByLayer2.jpg (427.44 KiB) Viewed 471 times
Next I created Layer 1 with red for it's color and big, bold lines so it is easy to ID. And I inserted two instances of the Library Part ON LAYER 1. The two text labels were added to make it easy to see which layers were visible and invisible.
EverythingByLayer3TwoOnLayer1.jpg
EverythingByLayer3TwoOnLayer1.jpg (532.61 KiB) Viewed 471 times
I exploded the instance on the right.
EverythingByLayer4OneExploded.jpg
EverythingByLayer4OneExploded.jpg (519.24 KiB) Viewed 471 times
Now it gets interesting. With Layer 1 invisible, the remaining instance of the part disappears, EXCEPT FOR THE BLOCK ATTRIBUTE which remains visible and RED which is the color of Layer 1, not Layer 0 which is black.
EverythingByLayer5Layer1Off.jpg
EverythingByLayer5Layer1Off.jpg (505.46 KiB) Viewed 471 times
And with Layer 0 invisible, only the part on Layer 1 shows, not IT'S Block Attribute.
EverythingByLayer6Layer0Off.jpg
EverythingByLayer6Layer0Off.jpg (512.07 KiB) Viewed 471 times
If I select the remaining instance of the part, the Property Editor says it is on Layer 1. But if I select only it's Block Attribute, it says that is on Layer 0. Yet it is getting it's color from Layer 1.

All components of the exploded part are on Layer 0.

The same thing is happening when I use my parts in a drawing. The part itself is on whatever layer I place it on but it's Block Attributes are on Layer 0.

I can't believe this is how it is supposed to work. Am I missing something?

I am attaching the file.
Attachments
MyScratchpad05InGrid.dxf
(148.33 KiB) Downloaded 20 times
Paul A.
SE Texas
Windows 10
QCAD V 3.29.3.0

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Blocks - How They Work?

Post by CVH » Wed Feb 28, 2024 3:38 pm

Chips&Chips wrote:
Wed Feb 28, 2024 1:20 pm
I can't believe this is how it is supposed to work. Am I missing something?
Already tested it with the same results.
See: https://www.qcad.org/rsforum/viewtopic. ... =15#p43857

With EverythingByLayer5Layer1Off.jpg
The Block Attribute remains visible because it is created on layer '0' and not on Layer '1'
<< Block Attributes are created on the intended layer by their Attribute Definition in the Block definition >>
The Block Attribute inherent the Block Reference color attribute, being on Layer '1' that is red even when this layer is hidden.
<< For some reason Block Attributes entities associated with a Block Reference inherent the Block Reference attributes like color >>
This implies that you have 'best compatibly' active for layer '0' because the Block Reference is lives on layer '1'.
Then this seems true even when the Block Attribute is itself not an entity defined in the Block definition, it is created from.
This is not true for orphaned Attribute entities because that are entities on their own.

With EverythingByLayer6Layer0Off.jpg
All on layer '0' is hidden except the Block Reference on Layer '1' because of the 'best compatibly' rule.
The associated Block Attribute is itself created on layer '0' and thus not visible.

Bottom line:
I can explain the behavior in this case but probably you might prove me wrong based on the same rules and assumptions. :wink:

I think it is not intended to be used as such.
(Layers are basically intended to define how all entities that live on them are displayed or printed ... With exceptions)
For example:
-> We would define Attribute Definitions entities on a dedicated layer for all Block Attributes.
-> Define other Block entities on layer '0' so that they may inherent the Block Reference layer attributes (=General Properties) with 'best compatibly'.
-> One can also include center lines on a layer 'Center' as Block entities and these must not comply with 'best compatibly'.
We can now toggle the visibility of the Block Attributes and/or the Block geometry and/or center lines.
Apart from being on another layer the Block Attributes inherent the Block Reference Color, Lineweight, Linetype, ...

Indeed, the layer property may be different when selecting Block References and Attributes together or only the Block Attributes.
Mentioned halfway https://www.qcad.org/rsforum/viewtopic. ... 651#p43869
Selecting 'together' is by preference, see: App.Prefs. .. Graphics View .. Behavior .. Blocks ...
But I can't select only the Block Reference when there are associated Attributes ...
#EDIT# O, I see, Select 'together' and then filter on Block References and intersect with the Selection Filter.

Please don't compare with exploded, stacked Blocks or using 'By Block' because all said may not hold anymore. :roll:

And please diversify between:
- Attribute definitions entities in Block definitions
- Block Attributes entities or Attribute entities associated with Block References
- Attribute entities or orphaned Attribute entities that are not upwards associated with Block References
(There is no downwards association stored in Block References)
- Attributes in the meaning of General Properties of entities or layers (Color, Lineweight, Linetype, ... Visibility, Frozen, ...)

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”