How to macro the change object layer button?

Talking about this little button.

I can’t work out the command for this?

-_ChangeToCurrentLayer

Hi,

Thanks for your help, but that command changes the selected object to the active layer.

The button changes the selected object to the highlighted layer. (which is what I want)

Hmmm I can’t find such a command either. Using the ‘ChangeLayer’ command and manually selecting from the list of layers might be a viable option for you?

No I’ve already tried that.

I would really like to bind this button to a keyboard shortcut to decrease the need to pick that little button so often

You can try this script and let me know how it works:

ChangeObjsToHighlightedLayer.py (791 Bytes)

Seems to work perfectly at first glance, thank you !