[WISH] Preselecting layers when selecting the objects

In a multi level layer structure. When selecting the object. The only indication of its layer is down in the statusbar, but there the full name of the layer path is displayed. You have to hover the mouse there to read the actual layer. Then go there looking for that layer in the layer panel.

It would be very useful to have two options:

  • when selecting the object its layer to be highlighted and centered in the layer panel.
  • alternatively, when right-click hold context menu appears to have a buttton there to highlight and center the layer in the layer panel.

Thanks in advance.

You can use the Select object layer. Useful tool but a little bit hidden.
At least a button for this function next to the tools button would be good to have.

1 Like

This is a nice one, didn’t know about it.

But still to have that selected from the object is much more practical.

It might move the list of layers up and down too much if you select layer each time you select an element.

You may omit the centering, just highlighting. All of these should be user-defined. Have you worked with CATIA? You can see how it works there.

Could be.
What concerns me more now is that the select object layer tool doesn’t work with the worksession and it’s a pain to find layers.

Hi @ivelin.peychev, This feature request has been made often yet. But i think you’re getting a funny layer disco with it and it may be annoying and slow in larger files with multiple (collapsed) layers.

If you want to write this yourself, the following ingredients are required: Setup 3 events which keep track of the objects beeing selected or deselected:

# required events

In each event, you’ll have access to the objects beeing selected or not and access the LayerIndex from the ObjectAttributes. Each event should access a global variable (a set) of layer_indices and be able to add or subtract from that global set. Each event should update the selection state of the layer(s) using:

# highlight layer(s) in the layer dialog
scriptcontext.doc.Layers.Select(layer_indices, False)

You might also control if the user is within a command and prevent layer selection then…

1 Like

I formally request permission to use this name for my plugin :smiley:

Accepted if it makes us all dance :partying_face:




Do you know how can I add additional button in the right-click hold context menu when an object is selected?

Sorry no. But you could create your own context menu using:

Rhino.UI.Dialogs.ShowContextMenu(items, screen_point, modes)