DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

3d Blocks, layers, and visibility discussion

Started by prl, January 02, 2013, 11:17:01 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

prl

Since we are exploring blocks, there are visibility rules for using them.  To start the discussion I modified the piano Minstrel made in the other topic.  The piano is a nested block assembly with an outer block for the total piano, two nested assembly blocks; one holding the legs, the other the keyboard, and then individual blocks for the individual solid pieces (body, left leg, etc.)

With the drawing loaded, examine the layers.  DesignCAD tells you there is only one layer with one item on it, layer 20. 

Now in DesignCAD under the Options Menu>options>view tab, uncheck the "Host layer controls symbol visibility" setting.

Even though layers 11 to 16 are empty, toggle on/off the various layers and watch the model.


Repeat your experiment with "Host layer controls symbol visibility" setting ON (checked).


Pretty neat. 


But, as a point of interest if you were to cut/paste the nested block to another file, the empty layer names will NOT go with the block.  So in your other drawing you're flying blind.   Plus if you have other things on layers 11 to 16 and you turn those layers off, you may be wondering why pieces of your piano are missing. 

Generally not a problem if you keep "Host layer controls symbol visibility" setting ON (checked).  But there may be times you want to toggle on/off portions of your piano or airplane or ship etc. 

Two different modes to keep straight in your mind.


By the way, this is for exploring with DesignCAD, not SketchUP.  The piano drawing is a three deep nested block so it will not export to SU.



Dr PR

prl,

Thanks. But it would be more helpful if you would explain what you think happens with each option rather that saying "see what happened." It may not happen the same on every system.

Here are a few questions:

1. Assume you create all parts of a block on layer X, and then combine them into a block. Are there any invisible "containers" or whatever on some other layer? Is visibility controlled by layer X or some other layer?

2. What happens if you select the block on layer X and copy/paste it to layer Y? Does anything - especially some invisible "container" - remain on layer X? Is visibility controlled by layer Y or layer X?

3. If you select the block on layer X while layer Z is active, and then use the "A+" button in the Layers Toolbox to move the block to layer Z, does anything - especially some invisible "container" - remain on layer X? Is visibility controlled by layer Z or layer X?

4. If I have layer Z active and I place a new instance of the block with "Tools/Block Insert" on layer Z, are all parts of the block, including the invisible container, on layer Z, or is there something on layer X? Is visibility controlled by layer Z or layer X?

****

If in any case any part of the block is not on the layer I move it to or place it on, blocks are useless. If visibility is controlled by a layer that does not contain some of the visible parts of the block I will not use blocks. It is a totally silly idea.

Phil
DesignCAD user since 1987

prl

Quote from: Dr PR on January 02, 2013, 01:18:48 PM
Thanks. But it would be more helpful if you would explain what you think happens with each option rather that saying "see what happened

Phil,  the point of my posting this is for you and anybody else that is interested in blocks to simply play with the file.   The file has been prepared to help explore visibility "rules" as an example.

minstrel

prl,

Finally got some time to review your opening post.

Quote from: prl on January 02, 2013, 11:17:01 AM
Repeat your experiment with "Host layer controls symbol visibility" setting ON (checked).

I never had/have that option checked and was wondering when it would or could be of use.
Now I see it in action and though it's still rather 'vague' I at least know the option is available.


Quote from: prl on January 02, 2013, 11:17:01 AM
... as a point of interest if you were to cut/paste the nested block to another file, the empty layer names will NOT go with the block.  So in your other drawing you're flying blind.

Yes, and No.  When you examine the 'block' define/insert list you will see all of the 'blocks' have indeed been copied to the new file, but, as you discovered the 'layer' names have vanished and as it appears, so has the layer contents.

Simply select the copied/pasted block in the new drawing and 'Explode' - top level only.  Now check the 'layers' window and you will now see 'visibly *' where is block resides - the 'bummer', layer names are not restored.

If layer names are critical I advise doing a 'screenshot' of the original to help with the transfer process.
Just toggle visibility to re-identify whats on what layer. 

This would be a nice fix/enhancement for DesignCAD!

Minstrel




prl

#4
A few of the rules for those that don't like to "see it themselves".  Blocks are in essence mini drawings within drawings. They encapsulate the source layers of the original entities that are being blocked.

If you run DesignCAD with the "Host layer Symbol" setting OFF, it behaves like SketchUP.

Example, you create something on layer 5 and those items are then put into the block in addition to other things on other layers.  Later you turn off layer 5 while working in your main drawing.  What happens? Answer - whatever you created on layer 5 within the block will disappear. By the way, the invisibility will migrate upwards from the original source entities through all nested blocks to the topmost block.

Now, let's push this behavior some more.  Let's say layer 5 is empty in the main drawing but you are still using this same block.  Maybe you cut and pasted it from some drawing from five years ago.  You paste the block onto layer twenty.  Scanning your layers, no asterisk in the layer toolbox for layer 5.  Now turn off layer 5 even though it has and continues to be empty and unnamed.  What happens?  Answer - whatever you created on layer 5 within the block will disappear and the block has cloaked (hidden from you) the existence and importance of layer 5.

The rule - BLOCKS ENCAPSULATE THE SOURCE LAYERS OF THE ORIGINAL ENTITIES THAT ARE BEING BLOCKED.

If you don't want this behavior, then turn ON the "Host layer . . ." setting.  In my  example, turning off layer 5 will now not matter regardless.  Invisibility will migrate downwards from the top most block to the source entities (even through nested blocks).


Two different modes.  One for controlling visibility for portions of your blocked assembly, another for controlling visibility on only the total assembly.


I recommend folks play with the sample file I provided.  These behavior rules will become apparent but aren't necessarily intuitive until you sleep on them for a while..





Dr PR

prl,

I am not trying to be difficult, but I am not sure I understand your last post. Blocks, and especially nested blocks, are very complicated.

1. Your analogy of blocks being a "drawing within a drawing" is a good explanation. Blocks aren't anything but a place holder, and that place holder has to exist somewhere in a drawing. Somewhere else the definition of the block has to exist - a list of the objects in the block and the layers they are on.

When a block is inserted into a drawing, only the placeholder is inserted. The original objects in the block are not duplicated in the drawing.

But where is the place holder that locates the block in the drawing? Is it located on a specific layer, and if so, what determines which layer? Is it the active layer when a block is inserted into the drawing, or is it on the layer that was active when the block was originally created?

Where is the block definition that lists all of the components? Can this original block definition be seen in the drawing, or it is tucked away somewhere out of sight where it just exists as a reference for blocks that may be inserted into a drawing?

2. You can place blocks in a drawing in four ways.

One is to use the DesignCAD "Tools/Block Insert" function.

Another is to use the DesignCAD "Edit/Selection Edit/Duplicate" (N) function to make a copy of the block in the DesignCAD file without using the Windows Clipboard.

The third is to use the "Edit/Copy" and "Edit/Paste" functions (copy something to the Windows clipboard and paste it from the clipboard into any file).

You can also use "Edit/Selection Edit/Duplicate to Layer" function to create a new copy on a different layer.

Furthermore, you can move blocks between layers with the Layers Toolbox "Apply Layer to Selection" (A+) button.

Because of the vague and imprecise language being used in these discussions I am never sure when people say "make a copy" just which of these methods they are using. Furthermore, I do not know if each method produces the same results. They certainly do not work the same with some other drawing entities.

3. You say something works like Sketchup, but you don't say how it works. This is totally meaningless for people who don't use Sketchup (this is a DesignCAD Forum). How does it work?

4. You say you create something on layer 5 and then incorporate it into a block. Then you say turn off layer 5 "in your main drawing." Later you say you are using the same block by layer 5 is empty "in the main drawing." What is this "main drawing" and is it the same drawing as where the block was originally created? Are you talking about 1, 2 or 3 drawings?

5. You say "visibility will migrate upwards from the original source entities." How does it move (migrate)?

I think you are trying to say that IF the "Options/Options/View" "Symbol layers visibility controlled by Symbol Host Layer" option is not selected THEN the visibility of objects will be determined by the layer they were on when they were created before the block was defined.

So if an object existed on layer X when it was incorporated into a block, the visibility of the object in the block will be controlled by the visibility of layer X in any drawing the block is pasted/duplicated/inserted into.

6. But what happens if the block is inserted/pasted/duplicated/moved (A+) into a different layer from the layer that was active when the block was created? Is the visibility control layer absolute or relative?

For example, suppose an object was on layer 5 and the active layer was layer 7 when the block was created. The relative position of the object is -2 from the active layer (5 = 7 - 2).

If a new block is inserted/copied/duplicated/moved (A+) when layer 15 is active, will the block be inserted onto layer 7 or layer 15? If it is layer 15, is the object's visibility controlled by layer 5 (absolute) or by layer 13 (relative 13 = 15 - 2)?

Of course this brings up the question of how we are supposed to know which layers control visibility of parts of a block?

7. You say "invisibility will migrate downwards" from the top most nested block. I take this to mean that IF the "Options/Options/View" "Symbol layers visibility controlled by Symbol Host Layer" option is selected  visibility will be controlled by the visibility of the layer containing the top most nested block.

In more specific language, if you turn off the visibility of the layer "containing" the top most nested block, all parts of the block will disappear, regardless of what layers the objects were originally on when the block was created.

How are we supposed to know what layer the top most nested block is on? For me this is the most confusing part. What if there are no actual drawing objects on the layer that was active when the nested block was created? Will the visibility control layer be the current active layer where no actual parts of the block reside, or will it be on a layer that actually contains drawing objects?

If blocks are inserted/copied/duplicated/moved (A+) into a different layer from the layer that was active when the highest layer of the nested block was created, is the visibility control layer be the same as when the nested block was created or will it be the active layer when the block is inserted/copied/moved?

****

One last unrelated question. How many blocks can we have in a file?

Phil
DesignCAD user since 1987

prl

#6
Phil, you're overflowing with things you need to rearrange in your mind.  Can we get a fresh start with blocks?  Let's start in small sections if that is OK with you.

1.  When you define a block (not placed in the drawing), you are packaging the entities and the layers they are on into a subset drawing.  However at this point they exist only in memory, not in our drawing.  Part of this defining process is the block handle.  This block handle is the subset drawing's 0,0,0 location.  Everything within the block is related to the block's 0,0,0.  If you could save the block to a separate drawing and load that drawing, everything would load relative to the block's 0,0,0 as if it were its own drawing . . . which it is. 

2.  Now you create an instance.  The instance is a piece of data text, an insertion entity, a pointer, whatever you want to call it.  This piece of data text will be placed on whatever layer you are on when you create the instance.  The piece of data text is your block, nothing more.   If this piece of data text is on layer 20, then your block is on layer 20. The data text provides a pointer to memory for what to draw (the entities definition list, as if loading a drawing from disk),  the offset from the insertion point (the block's 0,0,0)  to the model's 0,0,0, the subset drawing's rotation angle, the  x scale, yscale, zscale etc. (all the things in the infobox) for the subset drawing, aka the block. When you select the block instance and load the infobox, DesignCAD is showing you the values for the data text entity.

3.  Now this block instance (piece of data text, a pointer)  is a single DesignCAD entity (type 26) and as such if it is on layer 20 and you turn off layer 20, everything the piece of data text represents (the subset block drawing), will turn off. 

(Yes, I know data text is an improper term, the data is binary . . . . but it could simply be one big long string with data fields separated by spaces. )

I'll stop here for the moment.  Let me know what you think.

Dr PR

prl,

Thanks. I pretty much understand all of this and agree with what you say. To paraphrase:

When I place objects in a drawing and then convert them into a block (using the default "Convert to block" option), those objects continue to appear on the screen, so something still exists in the drawing. Before blocking objects that exist on multiple layers, if I select them and open the Info Box it tells me that I have multiple objects on multiple layers. After defining the block the Info Box tells me it is a block and it is located on a single layer. Furthermore, that layer is the layer that was active at the time the block was created.

To me this indicates that 1) the objects have been blocked, and the definition (the list of objects, and their properties) is stored somewhere out of sight, and 2) that they have been replaced in the drawing by the block.

This block is just a reference, place holder, data text, pointer, whatever you want to call it that tells the program which set of objects to display in place of the block. For consistency with the DesignCAD Reference Manual let's use the term "block" to refer to the object that is placed in the drawing, and something like "block definition" for the list of objects that the block represents.

Before the block is created the individual objects are displayed. After the block is defined it is the block that is displayed. They look the same, but instead of actual copies of the objects the block just tells the program where to look for the complete description of the objects that the block represents. The block is a small pointer to the block definition, much smaller than the block definition itself. This is why inserting many copies of a block into a drawing doesn't expand the drawing size like creating multiple copies of the original objects will.

We also have the option when a block is defined to "Retain" the objects and "leave the selected entities as the original entities." In this case the block definition is created but a block is not inserted into the drawing. The original objects are not removed from the drawing, and it is these individual objects that are displayed. These original objects retain their original individual properties. They can be edited or deleted without changing the definition of the block that was created from them. So these original objects are not the block definition.

We have the option to "Delete" the original objects after the block is defined. In this case the objects disappear from the screen and are not replaced by a block. However, you can still place blocks in the drawing that look like the original objects. This means the block definition can exist without any actual blocks being used in the drawing. This is why we have the "Tools/Purge Unused Blocks" function - to flush unused block definitions from the drawing. Unlike blocks themselves, block definitions can be large and expand drawing size.

What's next?

Phil
DesignCAD user since 1987

prl

#8
Quote from: Dr PR on January 05, 2013, 02:55:32 PM
let's use the term "block" to refer to the object that is placed in the drawing, and something like "block definition" for the list of objects that the block represents.

Good.  I agree with using the terminology above.

Ok.  Let's knock out some of the less lengthy items in your list.

Your item 2:  You need "block insert" to get the first instance into your drawing.  Note the "block define" command will do it for you with "convert".  Once you have one instance, you may use "block insert" or any of the DesignCAD duplication methods.  The block is a single entity and will follow the same rules as if it were a line, a circle, text, etc.

Your item 3:  If "Host Layer Controls Symbol Visibility"  is off, DesignCAD and SketchUP behave the same way. Nothing more to this, just take my word for it.

Your item 4:  I was warning folks that since blocks encapsulate the layers they are on, if you transfer a block from one drawing to another drawing, the only thing that will show up in the destination drawing when you paste, is the single entity.  The paste acts like any other DesignCAD entity.  It shows up on the layer it was copied from.  So if you copied the block from layer 20, in the destination drawing, it will paste into layer 20.  What you may not realize is turning off layer 5, even though it may be completely empty and unnamed in the destination drawing, will turn off the encapsulated items in the block. Please try the sample drawing.

Your item 5:  Migrate implies movement.  Bad term - the visibility setting cascades upwards to the top most block.  Think like this -  your total assembly is a car on layer 20.  The wheels were drawn on layer 5.  You turn off layer five and if your wheels are part of higher assemblies, they will be invisible in those too.  Maybe layer 18 is your car less the body panels.  Your wheels will be missing too.

Your item 7: If "Host Layer Controls Symbol Visibililty" is checked, meaning ON, yes.

You item 7a:  When you select a block, the infobox tells you what layer the topmost block is on.  We don't have a decent block browser to tell us anything else at the moment.  You can cut and paste to a separate drawing to decompose your block one level at a time.


Misc questions - how many blocks.  I would guess similar to how many lines, or circle, or DesignCAD entities in general. I personally don't know.


OK.  Going to end for now. Yes,  I skipped item 6. With nested blocks, this can get interesting. Introduces the layer 0 concept and we can talk about that a bit later.

prl

#9
I'm back. 

Your item 6:  Your terms of absolute and relative are referring to the layers when the block was first defined.  The act of defining a block and the current active layer, as far as I know, doesn't affect anything.  In other words, the current active layer isn't recorded in the block definition.  What is recorded is the layers on which you have entities, whether they be primitives (lines, circles), compound entities (solids) or other blocks.   If you have items on layers 5, 10, 12 and you define the block, the block definition will always encapsulate those layers.  They do not shift relative to the current active layer or anything like that. 

So with that understanding, if you have a block on layer 7, it is an entity and it will be recorded as such on layer 7 when you block the block.  What I'm saying is when nesting blocks, you are encapsulating layers at nested levels.  Confusing??  Because of this, for 3d component modeling, many insist that all primitives and all drawing elements go on layer 0 and that only blocks go on layers.  This avoids having geometry and compound entities (solids) across layers. 

I realize the layer 0 discussion is a whole thing onto itself, but it aims to solve the problem of block layers from stepping all over each other.  Especially true in  DesignCAD which has the odd layering system that uses index numbers rather than names. Reusable components (blocks saved to files, aka DesignCAD symbols) can easily conflict with layer index numbers.  One person's layer 5 may be door knobs, another person's layer 5 may be shrubs.  Hide the landscaping in your drawing and all the door knobs are gone . . .  what the heck is going on?

Dr PR

prl,

Thanks. I followed all of that and it makes sense.

However, there is still one issue that is confusing.

Note: Options/View "Symbol layers visibility controlled by Symbol Host Layer" is not selected - it is disabled.

1. Create an solid object on layer 2. The Info box shows it to be a solid on layer 2.

2. Change the active layer to layer 3.

3. Select the object and create a block - use convert to block option. Call the block "X." Now select the object that you see on the screen and the Info Box says it is a block on layer 3 with the name "X." This makes sense since the original object on layer 2 no longer exists (except in the block definition) and what is there is the block we created on layer 3.

Disable layer 2 and the block disappears. Enable layer 2 and it reappears. The solid exists on layer 2 within the block description. So far, so good.

Disable layer 3 and the block disappears, even if layer 2 is enabled! ?WTF, over.

So it is necessary for both the layer of the object and the layer of the block to be visible for the object to be visible!?

4. For more fun I changed the active layer to layer 5 and inserted another block "X."

For it to be visible both layer 2 and layer 5 have to be visible.

****

Am I reading this wrong, or should the visibility of the layers containing the blocks (3 and 5) have nothing to do with the visibility of the objects on layer 2 if Options/View "Symbol layers visibility controlled by Symbol Host Layer" is not selected?

Phil

Note: I continued this by copy/paste into another drawing, and it works the same.

I am using V22.1 12/13/2012
DesignCAD user since 1987

prl

#11
Quote from: Dr PR on January 07, 2013, 05:36:05 PM
Disable layer 2 and the block disappears. Enable layer 2 and it reappears. The solid exists on layer 2 within the block description. So far, so good.
Disable layer 3 and the block disappears, even if layer 2 is enabled! ?WTF, over.
So it is necessary for both the layer of the object and the layer of the block to be visible for the object to be visible!?

Glad you are exploring.   Getting all the rules straight is an undertaking.  I'm making lists.

Regarding your experiment, yes.  The rule being the total block visibility is governed by the layer the block is on.  So if the "Host Layer Controls Symbol" setting is off,  to display portions of your total assembly, the relevant encapsulated layers must be set to visible and the block entity (top most parent) layer must be visible.

This block rule behavior appears standard.  I went and checked it with SketchUP and AutoCAD, same results.

Dr PR

prl,

Thanks. I'll have to ruminate on this a bit, but now I think I understand the main point of my confusion about block display.

I had created drawings with the original object on layer 2, then blocked it on layer 3. Then I created another object on layer 3 and blocked it on layer 4.

Turning off layer 3 would make both blocks disappear! Turning off layer 2 would make the first block disappear, and turning off layer 4 would make the second block disappear. It is totally screwed up!

Personally, I would call this a bug. Here is my reasoning:

****

I has assumed the visibility of objects within a block is determined by the visibility of the layers that the objects are in. The visibility of the layer the block is in would not have any effect on visibility of objects in other layers. In other words, blocks would behave just like individual objects, single layer groups and multi-layer groups. This makes sense, and to me is very desirable.

I had based that assumption upon the text of the V18 Reference Manual (and online help):

"An important difference between blocks and symbols is that the visibility of a block's entities depends upon the visibility of each part's host layer; therefore, a block can be drawn on different layers so only a part of it is visible. The visibility of an entire symbol depends upon the visibility status of the layer where the symbol is inserted."

This text is repeated under "Block Define" on page 256, again under "Manipulating a Block" on page 257, and again under "Load Symbol" on page 259. Seems like they are trying to tell us something. This is also repeated in the online help.

****

I had assumed that the Options/View "Symbol layers visibility controlled by Symbol Host Layer" applied only to symbols because nowhere in the Reference Manual or online help is this option associated with blocks. Nowhere!

We have an option to make symbol visibility controlled by the layer the symbol is on (host layer). To me that implies that if this option is off the visibility of objects will not be controlled by that layer. Otherwise, what is the point in having the option?

To make it even more confusing, look at the definition of the Options/View "Symbol layer visibility controlled by Symbol Host Layer" on page 34 of the Reference Manual:

"All objects are displayed in order, matching the layer where each object is located. An object on a layer with a lesser number will always be on top of an object on a layer with a greater number.

"Within one layer, objects are positioned in the order of their addition to the document. when the option is in Operation mode is turned on the Display Order settings work only within one layer."


Huh? Operation mode?? Looks like gibberish to me.

The online help for V22.1 repeats the first paragraph "All objects are displayed in order ..."

To me this clearly states that visibility of symbols is controlled by the host layer, but nowhere does it say this is true of blocks.

****

It looks to me as if symbols and blocks have become scrambled in later versions of the program. The Options/View "Symbol layer visibility controlled by Symbol Host Layer" was supposed to influence symbols only, and blocks were supposed to function like multi-layer groups. But somewhere along the line the code has been screwed up so the program can't tell the difference between a symbol and a block. This is probably why mixing groups, blocks and symbols sometimes corrupts objects.

For now I wouldn't touch blocks with a ten foot debugging probe!

Phil
DesignCAD user since 1987

Dr PR

OK, I took this one step further. I tested blocks in V15.3.

1. I created a solid on layer 1 and duplicated (N) it.

The Info Box says they are solids on layer 1.

2. I switched to layer 2 and defined the duplicate solid to be block X.

The Info Box says it is a block named X on layer 2.

3. I changed to layer 4 and inserted (Tools/Block Insert) a new block X.

The Info Box says it is a block named X on layer 4.

4. I disabled layer 1. Only the original solid disappeared. Both blocks remained visible. I enabled layer 1 and the original solid reappeared.

5. I disabled layer 2. Only the first instance of block X disappeared. I enabled layer 2 and the block reappeared.

6. I disabled layer 4. Only the second instance of the block disappeared. O enabled layer 4 and the block reappeared.

Note: there is no Options/View "symbol visibility controlled by host layer" option.

****

So in version 15.3 only the layer the block is on controls visibility. The layer the original object was on has no influence upon block visibility. Yuck!

So block visibility has been messed with between V15 and V18. V22.1 doesn't work like V15.3 or the way the online help and V18 Reference Manual says it should.

Phil
DesignCAD user since 1987

prl

#14
Quote from: Dr PR on January 07, 2013, 10:05:22 PM
I had created drawings with the original object on layer 2, then blocked it on layer 3. Then I created another object on layer 3 and blocked it on layer 4.

Turning off layer 3 would make both blocks disappear!

Phil, I always need to pause and think about these visibility rules. What you described is following the rules or so it appears to me.

Block #1 resides on layer 3 and encapsulates a cube solid drawn on layer 2

Block #2 resides on layer 4 and encapsulates a cube solid drawn on layer 3

Turning off layer 3 hides Block #1 entity using the top-most-parent rule and the second cube (part of block #2 on layer 4) is hidden because of the encapsulated original source layer rule.  So both items are hidden.

Turning off layer 4 hides only the second cube because Block #2 resides on that layer and so the top-most-parent rule applies. Layer 4 doesn't affect block #1 with either rule, so nothing happens there.

Does this help?


Oh yes, regarding version 15.3, I haven't gone there to compare (at this point).