Disappearing blocks.

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
teegee
Active Member
Posts: 26
Joined: Wed Sep 21, 2016 5:51 am

Disappearing blocks.

Post by teegee » Tue Mar 28, 2017 2:16 pm

Hmm, I just files the same bug as #1565, but I can't find a trace of it. Did I not enter it correctly?

So here it is again:

Blocks (or their contents) disappear when overwritten. To reproduce:

1) Draw circle
2) Select circle, BC, select center, name 'testblock'
3) repeat 2; circle is now gone.

See attachment.. This is latest linux pro release, not git.
Attachments
testblock.dxf
(99.21 KiB) Downloaded 392 times

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

Re: Disappearing blocks.

Post by andrew » Tue Mar 28, 2017 2:51 pm

You report is still there, but has been closed. Note that the bugtracker does not show closed bugs by default:
http://www.qcad.org/bugtracker/index.ph ... sk_id=1565

You are creating a recursive block (a block that contains a block reference, referencing the same block).
Recursive blocks cannot be displayed since that would take an infinite amount of time and memory.

teegee
Active Member
Posts: 26
Joined: Wed Sep 21, 2016 5:51 am

Re: Disappearing blocks.

Post by teegee » Tue Mar 28, 2017 3:06 pm

Ah, I see how the recursion is a an issue.. I didn't realize I was selecting the block the second time, instead of the separate entities. What I meant to do it to recreate the block with a different center point.

- Is there a way to retrieve my original block?
- It would be better to warn the user about recursive blocks (or refuse to redefine), rather than just disappear them..

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

Re: Disappearing blocks.

Post by Husky » Tue Mar 28, 2017 5:18 pm

teegee wrote:What I meant to do it to recreate the block with a different center point.
1) Draw circle
2) Select circle, BC, select center, name 'testblock'
3) Select circle, Explode (XP), BC, select new Reference Point, name 'testblock'
4) Warning Message!
Husky-2017.03.28-01.png
Husky-2017.03.28-01.png (6.2 KiB) Viewed 7818 times
"OK" will replace your Block with this new one and ALL Blocks in your drawing with this name.
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..."

teegee
Active Member
Posts: 26
Joined: Wed Sep 21, 2016 5:51 am

Re: Disappearing blocks.

Post by teegee » Wed Mar 29, 2017 3:56 am

Thanks Husky. Still, it isn't very user-friendly to disappear blocks if they are recursive by accident (ie. user error). I tried to recover my circle as folows:

- Select all, to select invisible block. Property editor shows Block Reference (1)
- XP (nothing seems to happen)
- Save file:

Code: Select all

Command: save
Empty Record name: <AcDbBlockReference> (3A)
File [...]/testblock.dxf has not been saved.
Oopsie. Something is buggy here..

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

Re: Disappearing blocks.

Post by andrew » Wed Mar 29, 2017 7:45 am

teegee wrote:- Is there a way to retrieve my original block?
No. Your block now only contains a reference to itself, nothing else.

1. A circle is created.
2. A block called "testblock" is created (containing the circle).
3. The existing block "testblock" is overwritten (=replaced) by a new block, containing a single block reference that points to block "testblock", i.e. itself. The circle is gone at that point. If you are still in the same session, Edit > Undo will work of course.
Empty Record name: <AcDbBlockReference> (3A)
I can reproduce this here and this should be fixed for the next release. However, "fixed" means that the block reference will simply be skipped when saving. What happens is that QCAD "grounds" the recursive block reference on loading to avoid any further problems with it by setting the referenced block name to an empty string. This is then caught as an error when saving.

For now, you could manually delete the offending block reference before saving.

teegee
Active Member
Posts: 26
Joined: Wed Sep 21, 2016 5:51 am

Re: Disappearing blocks.

Post by teegee » Wed Mar 29, 2017 7:59 am

andrew wrote: 3. The existing block "testblock" is overwritten (=replaced) by a new block, containing a single block reference that points to block "testblock", i.e. itself. The circle is gone at that point. If you are still in the same session, Edit > Undo will work of course.
OK.

I still think QCAD should reject the block (re)creation, or you're going to get more dummies in the future asking the same question as me :)
andrew wrote: For now, you could manually delete the offending block reference before saving.
OK, thanks

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

Re: Disappearing blocks.

Post by andrew » Wed Mar 29, 2017 8:56 am

teegee wrote:I still think QCAD should reject the block (re)creation, or you're going to get more dummies in the future asking the same question as me :)
Unfortunately, that would be potentially very costly. At the moment, a block is created from selected entities without having to look at them. Preventing block recursions when they are created would require QCAD to look into all blocks referenced by all block references directly or indirectly, traversing them and looking for other block references, etc.

There are also many different ways to create recursive block references (copy / paste, property editor, etc.)

This is a case in which it is far easier to just let it happen and then try to deal with it in as gracious a way as possible.

I would expect most users to probably hit undo when something unexpected happens (such as disappearing entities).

Post Reply

Return to “QCAD Troubleshooting and Problems”