R6 wishlist: Manage layers within blocks

Hello,

sometimes I have to clean up layers to meet layer standards, but layers within blocks can not be accessed. How do you think about adding a “merge” function to the layer manager, so that all objects, including objects within blocks can be moved from one or several layer to one other layer? Additionally you could select if it keeps all custom properties like linewidth, display color ect, or change them to “by layer”, or “by parent”.

For the interface it could be done within the layers window. If you select one or more layers and press the right mousebutton it could have the option “merge”. If you select that it could bring up a window “select target layer” with all layers of the drawing and a selection field with the three options: “keep properties”, “set properties by layer” and “set properties by parent” (and of course “ok” and “cancel” button).

How do you think about that?

Ramon, can you please give some specific examples of what you’d like to do? if is a matter of moving the objects inside a block to different layers, you can do this inside BlockEdit.

-Pascal

Hello Pascal, obviously I can do that. Nevertheless sometimes I have a drawing that after purging has about 1000 block definitions and 150 layers of which 50 layers do not comply a client wise layer standard. Usually those layers were imported with some blocks definitions of external suppliers. If now I move all objects of one layer to another layer I still can’t delete it if there is a block definition with that layer. Now I get the information of one (of maybe 20 different) block definition containing that layer which I have to edit manually then return to the layer window and get the next name. It is tedious process. Usually I have to rename and number the layers so they kind of comply and for the dwg files the clients demand I have to do the cad standards in Autocad. For other clients where I stick all the way to Rhino it would still be neat. Regards

Von meinem Samsung Gerät gesendet.

Hi Ramon- this should not be the case, if I understand you- l think if there are no objects in the block definition that reside on the layers, you should be able to delete the layer.

Are these linked or embedded blocks? I suppose embedded.

Can you provide a really, really simple, stupid-simple example file with one or more of the layer management problems you’d like to solve? Who knows, maybe there is a way to do what you need…

-Pascal

Pascal, I’ve run into that too with embeded blocked. Creating a block on any layer will prevent the layer from being deleted.

Ref: V6: Making a Better Block Manager

It’s more like: you can’t delete layers that contain objects which are a part of any block definition in the document. Which makes sense, IMHO.

I think what @ramonkarges is after is being able to set the property (in that case Layer) of all the objects contained within a block definition (or many definitions at once) so while they are all moved to single layer, all other layers can be ‘cleaned up’. Pretty common need and nuisance with large CAD files coming from various sources. Currently this functionality can be scripted (apart from using one by one BlockEdit).

Jarek,
you understand what I talk about. If a layer I want to move to a different layer is used in different blocks I have to manually edit every single block definition, which can take hours.
The other tool you mentioned could also be useful in many cases. Selecting different block definitions and changing all content to one layer of choice. Additionally you could edit the other properties like color or print width. Very nice indeed! Unfortunately it only works if the content of the blocks is supposed to be on a single layer. Sometimes they are not (for example hatches within blocks which can be switched off in larger scales).
So I think the approach to access layers within bocks by “merging” layers would still be of additional use.
Don’t missunderstand me. I generally love the ease I can work with layers in Rhino it is usually much better than e.g. Autocad, just that blocks are so difficult to access in complex drawings is a drawback.

Hi Ramon- so, the basic level the tool might do something like

For all block definitions that contain the layer X, designated by the user, get all of the objects from each layer X and put them on layer Y, also designated by the user, creating it if it does not exist.

is that correct?

-Pascal

Hi Pascal,

i guess he does not only want to change the layers to another one (or new one) but also copy all attributes from the purged layers to be by object which was on the old layer. (Color, Material, Linetype, PrintWidth, PrintColor). All this should be scriptable.

c.

Hello Pascal,
actually I would not like to have a different tool in Rhino. Just expanded possibilities. I think there could be two approaches.
The one Jarek suggested, which would be a way to access the properties on the subobject level of selected blocks in the drawing or alternatively of a selection within the block manager. In praxis it could be a selection field in the properties manager where you can select the hierarchy level you like to edit. At the moment all editing effects the top level. If you have a block selected you should get an option to edit the sublevel. If you have nested blocks you should be able to select the level you like or all sublevels.
My suggestion was meant for the layer manager. There you can currently select all “toplevel” objects on that layer and change the layer. That is great, but it misses the sublevel objects within blocks. I suggest to add an option to the flyout you get when you rightclick on a layer selection. That option would be “merge”. What the tool does is to select all objects on these layers on all hierarchy levels (also within blocks and nested blocks), change the layer to the target layer and delete the source layers. There should also be the possibility to at least change all properties of all objects to be changed to “by layer”. To have further property options could be helpful (e.g. “by parent”).

Von meinem Samsung Gerät gesendet.

I understand that, that is why used the phrase ‘basic level’ Baby steps…

-Pascal

But, apart form any implementation details, is my summary of the basic functionality that you need correct, even if incomplete? Would being able to do what wrote help solve the problem?

thanks,

-Pascal

@clement
Actually my main goal is to be able to change all objects on a particular layer to another layer- including objects embedded in blocks- in order to be able to delete that layer.Especially if that layer is used in a large numbers of blocks.
Nevertheless sometimes there are blocks containing objects with strange properties like extreme line thickness. To be able to get rid of all custom properties in that process could be helpful.
If there was another tool to change the object properties within a large number of blocks simultaniously there was no need for that option as you could do it easily afterwards.

@ramonkarges,
In my workflow I use a lot the functionality of setting block/in block objects custom display mode, so I took that script and added options to change all blocks’ Layer or reset all blocks and their objects properties to ByParent or ByLayer (Color,Material,Print Color, Linetype, PrintWidth), on top of ObjectDisplayMode setting. It should work on nested blocks as well, no matter how deep they are. I have tested it only briefly but all seems to work. Not tested on referenced files blocks. I imagine this script can be further enhanced to allow setting more custom attributes to ‘in-block’ objects (color, material, etc.).

You can select block instances to process or select from the all block definitions list (in that case all instances will also be affected).

here’s the script:

DIG_BlockProperties.rvb (6.1 KB)

hth,

Jarek

@ pascal
I’m sorry I missunderstood you. On a basic level program wise this is correct. This is the additional function. In a tool it should be combined with existing functions.
@ jarek
Thanks a lot! I will try your script and give you response.

Thank you Jarek, I tested your script and it works like a charm!
It will be very helpful in my work, until these functions are integrated in some way in the official build.
It changes all nested blocks as well.

I tested it also with linked blocks and it affects those as well. As expected those changes are only effective until refreshing the block (opening the drawing the next time). If the layers are referenced it does not work. Somehow it makes sense, Maybe it would be better not to affect referenced blocks at all, but I’m not sure about that.

The script does not change linetypes, which is the most common option I guess. Maybe it could be altered in a way that all adaptions could be selected for, similar to the match properties panel.

Testing your script I stumbled over a little bug in the WIP version I will report now in a different post if it has not been done yet.

Hi Ramon,

I have tested it (in V5 only) and the linetype settings seems to work OK over here. Do you have LineTypeDisplay option ON? Other than that can’t think of any other reason…
I have revised the script to give you an option which properties will be affected by ByLayer or ByParent setting:

DIG_BlockProperties.rvb (6.7 KB)

hth,

–jarek