User name:
Password:
Forgot password?
Create an account!
« back
Please log in to write a message.
3. ledisnomad (Dec 08, 2009 16.19):
Hi, Hanno. Thanks for the reply. I used the ObjectsByLayer method and it works perfectly. I thought I'd looked for a method like that, but obviously I didn't find it. I uploaded the script as well as a second one that is a pseudo-block editing script. A work-around. Thanks again, Damon
2. Hanno (Dec 08, 2009 09.57):
Hi! You can use a hyphen in order to prevent rhino commands from popping up dialogs: -_SelLayer will let you type the layer as a parameter. But there is also a RhinoScript method called ObjectsByLayer that directly gives you all object ids on a layer, so you don't need to use command scripting at all. Hope that helps! Hanno PS: you can of course upload your helper library to RhinoScript.org. I'm sure many people will find it useful!
1. ledisnomad (Dec 07, 2009 20.25):
I'm trying to create a set of simple helper scripts. The one I'm working on now I want to hide, isolate or make current the layer of the selected object. That is, a user selects and object, starts my command "ByLayer" and has a choice to 1. Hide all objects on that layer (NOT turn the layer off). 2. Isolate all objects on that layer (NOT turn off all other layers). 3. Make that object's layer the current layer. I thought it was going to be a 10-minute script: got the thing started, option 3 is one line and works, but I can't get option 1 or 2 to work. Here are the functions:
The problem is, the
then pops up a dialog box for the user to select a layer, defeating the purpose. Do I have to iterate through all objects to check the layer? What am I missing? Any help would be appreciated. Thanks.