Odd behaviour for Block Attributes

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.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Odd behaviour for Block Attributes

Post by Husky » Wed Oct 05, 2022 2:30 am

HI ryancousins,
ryancousins wrote:
Tue Oct 04, 2022 7:40 pm
I was just trying every different variation I could think of to try and reproduce what is happening to BertMV. :wink:
My explanation was also addressed at BertMV based on his way of proceeding :wink:
BertMv wrote:
Tue Oct 04, 2022 10:07 am
1. I created a block with an attribute (named Block-With-Attribute) and turned it into a library (named My_Library)
2. I created a block with an attribute (named block-with-same-name-as-library) and turned it into a library (named block-with-same-name-as-library)

A. When importing My_Library, this gets placed on the active layer, but without access to the attributes in the property editor, I need to remove it and replace it with Block-With-Attributes (Understandable since it references My_Library instead of the Block-With-Attribute)
B. When importing block-with-same-name-as-library, this does give me access to the attributes without having to replace it, but it gets placed on Layer 0 so I need to change its layer (or remove it and replace it from the block-list, same as under A.)
1 + 2 creates a block overlaid by a block. Inserting such a Library item into a drawing will insert TWO blocks. The attribute from "Block-With-Attribute" isn't accessible because the "My_Library" block has overlaid the "Block-With-Attribute" block. The Property Editor sees only "My_Library" which doesn't has any attributes. Explode that block ones and you will get again access to the "Block-With-Attribute" block.
Scenario "B" behaves differently because both blocks have the same name. One block is overwritten by the other same name block. The Highlander principle ... :wink:

BertMv wrote:
Tue Oct 04, 2022 10:07 am
So basically, my question is this: How do I import a block so I actually place a block-reference in the active layer directly? (Without having to use predefined layers in the block itself)
Design that"Future Library Item" in Model_Space on layer 0 - do not create a block.
Select everything what needs to be part of it and create a Library item (BT) below Menu/Block. Save it to your Library folder and you should get something like this ...

Blocks.gif
Blocks.gif (3.14 MiB) Viewed 2402 times
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

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

Re: Odd behaviour for Block Attributes

Post by CVH » Wed Oct 05, 2022 5:59 am

Husky wrote:
Wed Oct 05, 2022 2:30 am
Design that"Future Library Item" in Model_Space on layer 0 - do not create a block.
Correct, and to store an existing Block as "Future Library Item":
- Insert a Block Reference (BI)
- Reset (QQ) and select the Block Reference
- Explode the Block Reference (XP)
- Without changing focus: Create Library Item (BT)
- Indicate a reference point, select a folder and provide a name.
- Without changing focus: Delete selected (ER or [Delete])

Or does anyone has a single click solution?

Before I tried BT of the Block in edit mode but that doesn't work out.
(Remark: Edit Block (BE) mode and not Edit Block In-place (BB) mode there I need to avoid this > FS#2179)
The Library Item dxf file will include your block definition perfectly but Model Space is empty.
On inserting nothing happens nor is the block definition transferred.

This reminds me of an endeavor to export Blocks: https://www.qcad.org/rsforum/viewtopic.php?f=30&t=8756
We shared some trials by PM but then it died out.

Regards,
CVH

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Odd behaviour for Block Attributes

Post by Husky » Wed Oct 05, 2022 7:56 am

CVH wrote:
Wed Oct 05, 2022 5:59 am
Husky wrote:
Wed Oct 05, 2022 2:30 am
Design that"Future Library Item" in Model_Space on layer 0 - do not create a block.
Correct, and to store an existing Block as "Future Library Item":
- Insert a Block Reference (BI)
- Reset (QQ) and select the Block Reference
- Explode the Block Reference (XP)
- Without changing focus: Create Library Item (BT)
- Indicate a reference point, select a folder and provide a name.
- Without changing focus: Delete selected (ER or [Delete])
1. I wasn't asking for your blessing!
2. This approach will NOT save an existing block as a "Future Library Item". You destroyed the block with explode before it was saved to the library folder!
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

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

Re: Odd behaviour for Block Attributes

Post by CVH » Wed Oct 05, 2022 8:15 am

Husky wrote:
Wed Oct 05, 2022 7:56 am
2. This approach will NOT save an existing block as a "Future Library Item". You destroyed the block with explode before it was saved to the library folder!
By your own observation:
Inserting this new Library Item turns it back in a Block with the Library Item name.
Without XP one gets stacked Blocks, one with the Library Item name referencing a Block with the original Block name.
Beside a Block Reference, two Block definitions are created.

When I read the first post and others carefully, BertMv has a Block including Block Attributes and wants to store it correctly as a Library Item.

My 2cent.

Regards,
CVH

BertMv
Junior Member
Posts: 11
Joined: Fri Sep 30, 2022 11:39 am

Re: Odd behaviour for Block Attributes

Post by BertMv » Wed Oct 05, 2022 9:13 am

Husky wrote:
Wed Oct 05, 2022 2:30 am
1 + 2 creates a block overlaid by a block. Inserting such a Library item into a drawing will insert TWO blocks. The attribute from "Block-With-Attribute" isn't accessible because the "My_Library" block has overlaid the "Block-With-Attribute" block. The Property Editor sees only "My_Library" which doesn't has any attributes. Explode that block ones and you will get again access to the "Block-With-Attribute" block.
Scenario "B" behaves differently because both blocks have the same name. One block is overwritten by the other same name block. The Highlander principle ... :wink:
Ohhh. So it was my stupidity after all ;) I keep trying to "translate" QCAD into my old ACAD way of working, old habits die hard.

Thank you so much for clearing that up, I get it now. Does raise a question about nested blocks though, but that isn't something I need yet, so I'll cross that bridge later.

Thanks to all of you for your patience and help and please excuse my density.

Post Reply

Return to “QCAD Troubleshooting and Problems”