Nested blocks, back to previous block

Use this forum for all posts and questions about the free QCAD Community Edition version 3

Moderator: andrew

Post Reply
User avatar
massimo
Full Member
Posts: 67
Joined: Tue Dec 02, 2014 2:30 pm

Nested blocks, back to previous block

Post by massimo » Wed Jan 26, 2022 7:41 am

Hi,

I have many nested blocks. I can enter to edit those blocks by double clicking a block, then double clicking the next block inside. How could I exit and go back to the previous block? "em" just always goes back to the main drawing.

I'm not sure if it's a good design to have nested blocks. But in very large projects it's useful. For the said issue I tend to move nested blocks to the main drawing in order to have only 1 level of block-trees.
Community Version 3.28.2.0, Gentoo Linux on amd64

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

Re: Nested blocks, back to previous block

Post by CVH » Wed Jan 26, 2022 9:12 am

massimo wrote:
Wed Jan 26, 2022 7:41 am
How could I exit and go back to the previous block?
There is indeed no stepping back.
What you do in the Model_space block is simply: Edit Block (BE).
The same is true inside any other block.
Perhaps you could enter a feature request.

'EM' is just the shortcut for "Return to Main Drawing" aka Model_Space.

Nested blocks are a common practice.
In CAD one uses Blocks for grouping things together.
I do agree that nesting blocks in several levels can become confusing regarding properties.

But say one has 10 flanges with each 8 bolts.
One would define a flange and a bolt and nest those as a 2 flanges with bolts.
Resulting in 10 block references to a bolted flange setup.
Using single level blocks one would have 100 unrelated block references.

Regards,
CVH

User avatar
massimo
Full Member
Posts: 67
Joined: Tue Dec 02, 2014 2:30 pm

Re: Nested blocks, back to previous block

Post by massimo » Wed Jan 26, 2022 9:42 am

Where can I file a feature request? Is https://qcad.org/rsforum/viewforum.php?f=31 the place to do that?
Community Version 3.28.2.0, Gentoo Linux on amd64

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

Re: Nested blocks, back to previous block

Post by CVH » Wed Jan 26, 2022 9:46 am

massimo wrote:
Wed Jan 26, 2022 9:42 am
Where can I file a feature request?
At BugTracker:
https://www.ribbonsoft.com/bugtracker/
You need to open a separate account there.

Regards,
CVH

User avatar
massimo
Full Member
Posts: 67
Joined: Tue Dec 02, 2014 2:30 pm

Re: Nested blocks, back to previous block

Post by massimo » Wed Jan 26, 2022 10:03 am

Community Version 3.28.2.0, Gentoo Linux on amd64

User avatar
massimo
Full Member
Posts: 67
Joined: Tue Dec 02, 2014 2:30 pm

Re: Nested blocks, back to previous block

Post by massimo » Thu Oct 05, 2023 1:04 pm

Hi, any comments if this is useful?
Community Version 3.28.2.0, Gentoo Linux on amd64

User avatar
massimo
Full Member
Posts: 67
Joined: Tue Dec 02, 2014 2:30 pm

Re: Nested blocks, back to previous block

Post by massimo » Thu Oct 05, 2023 1:20 pm

CVH wrote:
Wed Jan 26, 2022 9:12 am
Nested blocks are a common practice.
I have issues with nested blocks for a long time now, currently using the Community Edition, self compiled:

Code: Select all

Version: 
3.28.2.0 (3.28.2)
Internet: 
QCAD.org
Erstellungsdatum: 
Sep 15 2023
Revision:

Qt Version: 
5.15.10
Architektur: 
x86_64
Compiler: 
gcc 12.3.1
The issues are:
  • Sometimes the content is disappearing when zooming closer and re-appears when zooming out.
  • If I see the content, I sometimes cannot double click it for editing the block. I can't select it at all and I can't snap to it, eventhough it's visible. I need to know to which block it belongs and edit the block manually.
As far as I see this is only happening for nested blocks.
Community Version 3.28.2.0, Gentoo Linux on amd64

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

Re: Nested blocks, back to previous block

Post by CVH » Thu Oct 05, 2023 5:41 pm

massimo wrote:
Thu Oct 05, 2023 1:20 pm
The issues are:
Sometimes the content is disappearing when zooming closer and re-appears when zooming out.
If I see the content, I sometimes cannot double click it for editing the block. I can't select it at all and I can't snap to it, eventhough it's visible. I need to know to which block it belongs and edit the block manually.
Could you provide in a example file or part of it.
If proprietary then you could attach it to a private message (PM).

Regards,
CVH

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

Re: Nested blocks, back to previous block

Post by CVH » Fri Oct 06, 2023 5:21 pm

Thanks for the file.
I can not replicate the disappearing/re-appearing nor the discontinued snapping options.
The drawing acts a bit sluggish, about 2fps.
Returning to model space takes about 4-5 seconds.
True, that you have to wait when selecting something but then R-Click + Edit Block acts immediate.

Maybe I still have an edge over other users because I run QCAD in 32bit.
You mentioned that you compiled the CE version yourself.
I think that it is time to buy an everlasting single user licence of QCAD pro ... :wink:
The price will not and cannot be the issue in view of your building intentions.

Your drawing are in fact 8 views on 8 pages.
True, QCAD does not support XREF's but remind that ifso the content should be loaded and rendered just the same.

I would advice against Hatches in Blocks.
Hatches are intended to dress up your representation on paper, they have no structural meaning while designing.
Best practice so far is to isolate them on a dedicated layer and lock that layer while designing further.
One could even hide them for the time being.

I also have to advice against creating a block of a single brick or tile and then use that several hundred times to construct a wall or a floor.
(For example: A_Gruppe_Einfahrt)
The exact layout of the stones really doesn't matter.
John's Hyslop BHT includes a method by me to construct a herringbone hatching pattern. 244 by 122 or ratio 2 should not be a problem.

The first thing I did was setting just 1 viewport.
2 Viewports require twice the display re-rendering.
Not always twice but you get the picture. :wink:
I see no advantage when editing blocks, both viewports will show the block content.

Sometimes your hatching preferences are true overkill.
- Bubbles-01 ... Bubbles are or can be a demanding hatching method. Review John's Hyslop remarks on that.
- Celtic-01 ... At this scale for 15mm OSB. The details are in the range of 6mm for a thing that is 15mm by 6 meters long.
(In perspective that are 14094 individual line segments that make up the pattern)
- ...

Bottom line, keep it simple and to the point. :wink:

Regards,
CVH

User avatar
massimo
Full Member
Posts: 67
Joined: Tue Dec 02, 2014 2:30 pm

Re: Nested blocks, back to previous block

Post by massimo » Mon Oct 23, 2023 10:22 am

CVH wrote:
Fri Oct 06, 2023 5:21 pm
Thanks for the file.
I can not replicate the disappearing/re-appearing nor the discontinued snapping options.
Bad thing. Could you please try with the exact version built for 64bit? Why are you using a 32bit build after amd64 arch has become default since many years? Almost everything is built for 64 bit only on my machines.
This issue is blocking me since years. I should try to reproduce with a minimal example that I can publish.

My build is done on Gentoo with:

Code: Select all

CFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer -fvisibility-inlines-hidden"
FCFLAGS="-O2 -pipe"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--as-needed -Wl,-z,now -Wl,-z,relro"
I'm going to try to reproduce with a ready to use binary build from qcad.org
CVH wrote:
Fri Oct 06, 2023 5:21 pm
I think that it is time to buy an everlasting single user licence of QCAD pro ... :wink:
Where do I get an everlasting license? On the pages I just see a 1-year-updates-license. Does licensing mean I can only use the licensed binary build or can I license my own build?
CVH wrote:
Fri Oct 06, 2023 5:21 pm
Your drawing are in fact 8 views on 8 pages.
True, QCAD does not support XREF's but remind that ifso the content should be loaded and rendered just the same.
Sure.
CVH wrote:
Fri Oct 06, 2023 5:21 pm
I would advice against Hatches in Blocks.
Hatches are intended to dress up your representation on paper, they have no structural meaning while designing.
Best practice so far is to isolate them on a dedicated layer and lock that layer while designing further.
One could even hide them for the time being.
Thanks for the hint. So hatches are only expensive when enabled. Having one layer for all hatches doesn't work, as I have wood hatches, stell hatches etc. Actually I would need another hatch-layer for all different materials. But I guess a big number of layer isn't an issue. I would just not be able to disable all hatches with one layer click. And I can't group layers.
Another feature request: Adding some filter field for layers and blocks would allow to filter for "*_hatches" layers and enable/disable all together.
CVH wrote:
Fri Oct 06, 2023 5:21 pm
I also have to advice against creating a block of a single brick or tile and then use that several hundred times to construct a wall or a floor.
The exact layout of the stones really doesn't matter.
Thanks. Yes, at the end the floor bricks are just another kind of hatch, I could remove it. I thought it's just clever to do it like that.
CVH wrote:
Fri Oct 06, 2023 5:21 pm
The first thing I did was setting just 1 viewport.
2 Viewports require twice the display re-rendering.
Not always twice but you get the picture. :wink:
I see no advantage when editing blocks, both viewports will show the block content.
With viewport you mean the split screen? This is very useful to work on different areas, being able to have different locations and zoom factors. Currently QCad is always a big single window, just the toolbars can be detached. Using 3 physical screens, I usually have all toolbars on one screen and a split main-windows scaled over 2 screens.
CVH wrote:
Fri Oct 06, 2023 5:21 pm
Sometimes your hatching preferences are true overkill.
- Bubbles-01 ... Bubbles are or can be a demanding hatching method. Review John's Hyslop remarks on that.
- Celtic-01 ... At this scale for 15mm OSB. The details are in the range of 6mm for a thing that is 15mm by 6 meters long.
(In perspective that are 14094 individual line segments that make up the pattern)
- ...

Bottom line, keep it simple and to the point. :wink:
Very good, thanks. I'll keep that in mind.
Community Version 3.28.2.0, Gentoo Linux on amd64

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

Re: Nested blocks, back to previous block

Post by CVH » Mon Oct 23, 2023 11:16 am

massimo wrote:
Mon Oct 23, 2023 10:22 am
Could you please try with the exact version built for 64bit? Why are you using a 32bit build
No, I can't ... I run Windows7 32bit.
massimo wrote:
Mon Oct 23, 2023 10:22 am
Where do I get an everlasting license
A QCAD pro licence doesn't expire, the access to the personal download area does.
massimo wrote:
Mon Oct 23, 2023 10:22 am
Thanks for the hint. So hatches are only expensive when enabled. Having one layer for all hatches doesn't work
Hatches that are not on a locked layer can be highlighted when hovering over them when solid ...
... or near one of the pattern segments when patterned.
In the OSB case that are 14094 segments to account for ... :wink:
Once one is near your cursor all 14094 need to be highlighted ...
And the displayed view needs re-rendering ...

QCAD Pro provides in hierarchic layers and one could 'group' all hatch layers under a common one.
The same exists for CE but then it is not a tree layout, the parent-child layer name are separated by 3 dots.
massimo wrote:
Mon Oct 23, 2023 10:22 am
Using 3 physical screens, I usually have all toolbars on one screen and a split main-windows scaled over 2 screens.
I understand that but the price of the two extra screens, the cables and the dedicated graphics card can not be compared to a single licence fee.
:lol:

Regards,
CVH

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

Re: Nested blocks, back to previous block

Post by CVH » Mon Oct 23, 2023 6:56 pm

Coming back to the core question of this topic.
Nested blocks, back to previous block

A certain block 'xyz' can be nested in any other block ... Any number of times ... On any parent-child level.

Returning to Model_Space is obvious and implemented.
What you ask here is that QCAD keeps track of all your previous block edit actions ... By any feasible means.
Going back would only be obvious when the track is a clear singular pathway from Model_Space to 'xyz'.

Regards,
CVH

User avatar
massimo
Full Member
Posts: 67
Joined: Tue Dec 02, 2014 2:30 pm

Re: Nested blocks, back to previous block

Post by massimo » Mon Jan 08, 2024 2:47 pm

Isn't this "Go Back" function just the same like any hyperlinked browser must support? Yes, it is the custom path history that needs to be recorded for not having ambiguous back pathes available. That FIFO history might save the last 20 locations. In my opinion it is a comparable use case when browser hyperlink referenced documents or a block-referenced drawing. This could also be useful when jumping around in a drawing, not sure if it is possible to directly jump the view to objects or coordinates...

For not changing the current "Go back to Model_Space" (EM) you could also add another new "go back" or "Exit Back (EB)" or "Block back (BB)" function. I sometimes have the usecase when having a bested Block tree Model_Space->A->B->C, that I browse down the path to C and continuously need to switch between C doing changes there, then back to B with C nested and viewing the result.
Community Version 3.28.2.0, Gentoo Linux on amd64

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

Re: Nested blocks, back to previous block

Post by CVH » Mon Jan 08, 2024 5:35 pm

I understand the issue quite well.
I think that you mean a LIFO ... Last entry added to the stack is the first to turn back to. :wink:

It is quite easy to set the current active block:
For example di.setCurrentBlock(blockName);

The only requirement is a document related global Block Edit stack of some sort.
Remark that there are various ways to start editing a Block definition.
Remark also that Block definitions can be renamed or removed.
All this has an influence on the stack.
This might be worth looking at: https://qcad.org/doc/qcad/3.0/developer ... 3c4794162e
One of the references I find on 'previous block' ... https://github.com/qcad/qcad/blob/maste ... #L893-L904
But I don't find anything that recalls that 'previous block' in a documented way.

Remind the major difference between a Block Reference what is a single drawing entity and a Block definition what is a collection of entities.
Only Block References hold a reference to the referenced Block definition: getReferencedBlockId() or getReferencedBlockName() and are themselves part of a parent Block: getBlockId() or getBlockName() what can refer to the Model_Space Block.

The child - parent relationship may be ambiguous when we are editing a Block definition.
More than one Block Reference may refer to the current Block definition and there is no sort of last Block Reference with focus.

I don't say it won't be handy, I only say that there is much more to it than with the Back button of your browser. :wink:

Regards,
CVH

Post Reply

Return to “QCAD Community Edition”