There is a block definition on layer X, delete it before deleting layer

I also try to use Blocks with larger assemblies in Rhino and it’s a bit difficult to be perfectly honest. The error message in the OP can indeed be a bit frustrating - not that it necessarily excuses the tone.

@eobet the main “tool” to fix this error message for me is:

image

Select Object Layer” will reveal to you what layers source geometry actually sits on, once you go to all levels of your blocks/nested blocks. To prevent having to do that in the first place, what works okay for me is to keep all source geometry on the same layer tree syntax, including all files linked as blocks. It looks something like this:

0 _ block source geo
< item >
< subitem >

^ sadly this is quite a bit of work sometimes, and not possible work with non 3DM files of course.

I then use a similar syntax for the actual model and instances of blocks:

1 _ model
< item >
< subitem >

…In case you wanted to consider this.

@pascal it would be nice if we could get an organised blocks in rhino discussion going. I know this has been attempted on here before - has it been successful? I actually had high hopes here in regards to Rhino 6, but I’m not sure what has changed in the block manager. My (personal) main problem are the erroneous imports when files are linked as active reference blocks. This usually ends in a layer hotchpotch that cannot be fixed currently.

Hi Duncan - I assume you’ve reported this here or on tech@mcneel.com and we’ve let you know that we understand and/or can reproduce the problems and have made bug track items…? I am not sure with the ongoing stream of messages of all kinds here and my limited brain cells to begin with, that I can remember what it is exactly that you are referring to.

-Pascal

Hi Guys. I did not read all the stuff written on this topic (so the real problem could be somewhere else), but I reall love the Purge tool for cleaning up these things. It might not help with nested block, but it cleans unused blocks, layers and more without any need of the block manager.

1 Like

Ok… there’s a lot to digest & explain here. I put together a doc to train my team on how Blocks work in Rhino, and I think it might help. I apologize in advance for the length.

First: I’d like to define the sets of layers that we’re dealing with:

  1. The layer that was active when the block was created/inserted. This is the layer that shows up when you select a block and look at the properties. Let’s call this the “block instance layer”
  2. The layers that the sub-components of the blocks are on IN THEIR ROOT FILE. This is a key point. Since the whole assembly is a block, that block lives on a SINGLE layer in your current rhino model. However, that block consists of subcomponents (each of the parts in the rhino file that contains the block itself), and each of those subcomponents is on a layer in that file). Let’s call these “block subcomponent layers”

So what does that look like? Lets create a simple block to test how it works. This block is just a bunch of text, assigned to various layers in a tree:
image

In this file, things work like we’d expect. Turn off the root “block” layer, and everything disappears. Turn off just “1” and you lose the top but keep the bottom half. Etc.

Now, let’s insert that into another model as a block. First, let’s set up a basic layer tree in the new file:
image

Ok, with Layer 1A active, insert our sample block. Let’s insert it as embedded & linked, since that tells rhino to save the geometry from the block into our current file, but also remember where the root file is stored and check for changes to it. We’re going to insert it as a “block instance.”
First thing you’ll notice, is that you’ve got new layers:
image

When you insert a block, rhino will automatically add the ENTIRE layer tree from the block file to your current layer tree. (Note: if any of your layer hierarchy in the current file matches that of the block, it won’t duplicate those layers. Rather, it’ll add the block subcomponents to the existing layers. This is a key point, and we’ll get to what that means in a moment).
So, what does our file contain now? One block. If you select all, you’ll get a single item, and it’s on layer 1A.
image
What happens if you turn off layer 1A? Just like you’d expect, the entire block disappears.
So… what’s the point of bringing in all the layers from the block? What happens if you turn those off? For example “2”. First, try selecting all the objects in layer 2 or sublayers. You’ll get a message that there were no objects added to selection. So turning it off shouldn’t do anything, right?
image
On the contrary, it hides the subcomponents of the block that were (in their root file) on layer 2 (or sublayers). Even though they aren’t (in this model) on layer 2.

NOTE: WHEN YOU TRY TO DELETE A LAYER THAT IS CONTROLLING THE SUBCOMPONENTS OF A BLOCK, RHINO WILL TELL YOU THERE IS A “BLOCK DEFINITION” LOCATED ON THAT LAYER. THIS HAS LED MANY PEOPLE TO SEARCH DESPARATELY FOR THE “BLOCK DEFINITION LAYER CONTROLLER” SO THEY CAN RESOLVE IT. THIS ERROR IS NOT REFERRING TO THE “DEFINITION” OF THE BLOCK AS AN ITEM. WHAT IT REALLY MEANS IS THAT (AT LEAST) ONE OF THE SUBCOMPONENTS OF THAT BLOCK IS ASSIGNED TO / CONTROLLED BY THAT LAYER. In order to resolve this, you either need to get rid of the block (explodeBlock will remove the block reference and leave you with objects in your current model) or modify the layers in the block definition itself.

Why do you care / why is this a good thing? For a single instance of a block, this is a freaking pain in the butt… you mean I have to deal with TWO different sets of layers to control the visibility of a SINGLE object? That’s ridiculous.
I keep seeing posts saying this makes blocks “unusable” in Rhino. I’d like to propose the opposite… it seems confusing, but it’s the only thing that makes blocks usable in LARGE / COMPLICATED models.
So far, we’ve been looking at a model with a single instance of a single block. Let’s add a bunch more instances.
image
Ok, now we have 6 instances of the same block (the left three are mirrored). I’ve assigned each “instance” to a layer (as labeled / colored).
Now we get to see the first signs of the usefulness in Rhino’s block management system.
You might have noticed this looks kind of like a tournament bracket. Let’s say that each color/layer is a “division.” Then, inside of each block (division) you have the division quarter-finals, semi-finals, and finals.
If you want to see only Division 1A, you can turn off the other five layers/instances.
image

That’s pretty simple, and nothing to do with blocks. But what if you only want to see the semi-finals and finals, for ALL divisions? If this was setup in a traditional (non-block) layer tree, that would mean navigating to EACH division and turning off their quarter-final layer. But, because each division is an instance of the same block, you just have to turn off the layers of the core block definition (ABC)
image
Ok… but who does their tournament brackets in Rhino?
Let’s imagine a different scenario. You’re modeling an entire building… doesn’t even have to be that large. But you want it modeled well / right. The building has 5 floors, and each one has about a dozen rooms. So 60 total rooms. Figure 120 lights, 60 doors, 120 windows, etc.
First you model the general layout / rooms. Assign each floor a layer, then each room a sub-layer. Easy enough. Let’s add doors… Non-block procedure: Model 1 door, then copy it into place 60 times. You either leave all 60 doors on their own “door” layer, or you move them each to the layer of the room they’re in. Ok, same for the windows. And Lights.
You’ve probably got a layer tree that looks like one of these:


Ok… the layer tree on the right is obviously a mess, but at the same time, the layer tree on the left isn’t very effective. If you want to see just the 1st floor, you’d have to do so without the doors/windows/lights (or select and hide other objects). So the tree on the right is the “best” way to do it… but what about when you need more detail? Now your doors get sublayers for handles, hinges, door-jambs, mouldings, etc. Windows get sublayers for the same things. Lights get sub-layers for electrical wiring, trim, etc. Plus all their sublayers for screws / attaching pieces, etc. You get the idea. What would the layer tree on the right have to look like to accommodate all of that for a SINGLE room?
image

And that’s just for those three components… If there are multiple doors or windows or lights in a room you may need even more layers! And then you have to copy this layer structure for EACH room… now you’re talking about over 1,200 layers for this building, just to include doors / windows / lights… That’s not even remotely practical.
So where do blocks come in? Well, it depends on how well you name your layer structure. But let’s say you planned ahead and built all of your subcomponents to fit the following layer tree.

Now you insert them, as blocks, into the right rooms. What does your layer tree look like now?

Ok, I left off a few of the rooms for the sake of space, but even with ALL of them, you’re looking at only 50 layers. Compared to over 1,200, this is a HUGE reduction in layer count and increase in usability.

By turning off rooms, you still turn off the blocks that are inserted in them (so you can see just the 1st floor without the subcomponents of the other floors in the way). However, you can also turn off all of the doors, or all of the windows, or all of the lights… with a single click. Or you can turn off the screws and other details, and just leave the door panel (to speed up the rendering).

Also, this gets even MORE useful & necessary as the model increases in complexity. If you’re modeling an entire system with many components, and each component has copies of other components nested inside of it, then this system can be a life-saver… IF you set up the layers for your blocks right.

4 Likes

Also, @pascal @wim @bobmcneel @stevebaer @brian

One (relatively) simple way to fix the issues people seem to be having - When you insert a block, have an option for nesting all of it’s component layers as sub-layers in the new model (for example, if you insert Block X, have rhino put all of the layers for Block X in the layer tree as sublayers to a new layer titled “Block X Subcomponents”). For those that organize their block layers, they can leave that option off and use the current system.

But for people without a lot of blocks, or just getting started, this would greatly simplify the UI and leave them with a clear understanding of why they can’t delete those layers without deleting the block that creates/depends on them.

Here are the two files I used to illustrate the above post - in case anyone wants them.

Block insertion sample.3dm (79.2 KB) Sample Block.3dm (51.0 KB)

Pascal, I may have fixed the above mentioned issue yesterday when I fixed this YT issue
https://mcneel.myjetbrains.com/youtrack/issue/RH-54300
The fix went into 6.x so users will start seeing it in next week’s V7 WIP and in the SR 19 release candidate that will become available in a few weeks after that.

OK- thanks.

-Pascal

One even easier “fix” would be to change the error message to “a subcomponent of block [name] is located on this layer”

I general feelings are still that ever since 64-Bit, people will want to make larger projects in Rhino–and not export them to some other program.

I suspect that, in the past most people who have used Rhino have made small uncomplicated projects from sophisticated shapes…

…Grasshopper changed that.

I am only a guest here. It’s your company. You set your own goals, but please reconsider giving a little attention to what may not be the sexiest part of Rhino, but the part that will allow user to develop their projects to completion.

2 Likes

Blocks can solve problems with computer resources.

The only way I got around this was to create all blocks on the Default layer, and then move the instances to their perspective layers. Though, using this workaround can make a mess, such as if you need to explode a block for reworking, as it must be moved to it’s own work layer before exploding, then moved back to be made into a block again. I also hide everything else while I do this kind of exploding. Save incrementally, often.

[Exploding things such as the 500+ fasteners instances I needed to explode because of material changes.]

The current block metaphor is akin to programming with private objects that cannot access from Main–unless it’s Thursday.

image

How do you move a block instance? Right clicking on the layer and selecting “change objects to layer” doesn’t move it.

Yes you can. A block is both an instance that can be on any layer, and the objects it contains that can be on other layers. So moving a block to another layer does NOT move the content of the block to this layer :slight_smile:

@eobet, @Holo already answered it, but I’d like to add: a block is like an invisible container, yet it has to reside on a layer. The advantage is that you can both hide block instances (with its contents) as well as hide contents (without hiding the block instance, which is invisible, but could contain objects you want to keep visible)
Suppose the following scenario: you want to have a block of a wheel with tire and bolts, so you make a layer wheel_block, activate this layer and create a block (instance) of a wheel, a tire and 5 bolts, where these items reside on respectively wheel, tire and bolt layer.
Furthermore you create another block, car that also makes use of the same bolts, this time creating the block on car_block layer, adding items from layers body, and bolt.
Hiding the bolt layer will hide all bolts in all instances. Hiding the wheel_block will hide bolts only used in wheel block instances.

Ok, but I’m afraid neither of you actually answered my question. :slight_smile:

How do I move the block instance I selected in the viewport to the layer I want? Like, actual mouse click instructions, please, because I seriously can’t figure it out.

same as any other object or group: if you select it, you can either right click on a layer and move it to that layer or use the property rollout to see/change on which layer it is/needs to be

Dunno, select the instance, then find the layer you want to move it to in the layer manager, right click and choose “Change Object Layer”

In the file below, try this to move the block instance from InstanceOriginalLayer to InstanceNewLayer. Works here…

–Mitch

SBC_Block.3dm (595.4 KB)

Well, the screenshot I attached to my original question clearly shows that that doesn’t work.

Again, I’m working with imported (possibly nested) blocks here.

New related question:

How do I move a Block Definition to a different layer?

I have a Block Definition (that I created) that I actually want to keep now, but I’m reorganizing my layers.

Which one is it?

Post a file with one that is not working…