Changing layer, layer name in command?

Is there a way to specify what layer an object goes to in a single command?

I want to make it so pressing CTRL+H sends the object to a layer called hidden (which visibility is left off until needed obviously) instead of using Rhino’s hide system.

Almost everything I’m working on is getting linked into a parent file via blocks and hidden objects show that way. It becomes a real nuisance when I hide something, then render the parent file and hidden objects show up in the final render… :frowning:

Something like the following should do the trick - you will need to store the script somewhere and make an alias to call it.

–Mitch (361 Bytes)

Thanks Mitch!

I’m doing something wrong. It’s probably dumb. With other scripts i’ve dragged them onto rhino before the first run… this one didn’t seem to behave the same way.

This is a python script, it’s not set up for drag and drop. To set it up, the easiest thing to do is to put it somewhere - where you put the rest of your scripts is good - then for the alias use:

! _-RunPythonScript "Full_path_to_script"


1 Like

Bingo. Thanks again.

So, if we were going to take this HideProper script to the next level…

Technically speaking… Would it be possible to save the name of the origin layer somewhere in the objects metadata when you hide it, like the name or hyperlink field.

Then have an UnHideProper script which makes the hidden layer visible, user selects items same way as the usual unhide, then when done switches hidden layer visibility off again and moves the selected objects back to their original layers?

I know this seems like a lot of goofing around to do something rhino already does.

I can’t fathom for the life of me why hidden objects show in linked blocks… Like why anyone would want that.