Create Layers from object properties


#1

By far not an expert in rhino but required in my line of work to access 3d files for templates, measurements etc.
I run Rhinos on mac and problem I constantly run into is that designers sending out complex step files (stp).
Obviously, I am able to load files into Rhinos for mac and with “explode Block” command convert it into a workable model but every surface and curve is packed into a single layer and it is a task on its own to separate or single out components from complex models.
I found a rvb script that enables you to sort objects based on properties into separate layers but rvb script does not work in rhino for mac.
Does anyone know if there is a python script that does the same thing or is anyone able to translate below rvb script into python?

Thanks in advance for any suggestion and help.

http://v5.rhino3d.com/forum/attachment/download?id=6377196%3AUploadedFile%3A131413


(Dale Fugier) #2

@Helvetosaur, looks like something you might have put together. Do you have a Rhino.Python version?

Thanks,

– Dale


#3

I’m sure I can concoct one if not… Just that I am out of range of my computer for the moment. Will look later. --Mitch


#4

Thanks Guys for the quick response and for looking into a possible solution.
Looking forward to creating a custom button with the script.
Will save me ( and maybe others ) a lot of time in the long run.

Cheers and a great weekend to all.


#5

Hi there,
The script you mentioned simply creates a layer using the object name - if it has one - and puts the object on that layer. The problem is, it will do nothing if the object does not have a name. I don’t know if the objects you are importing actually have names, if they don’t the script won’t help you.

What object properties would you like to use to sort the objects if they don’t have a name?

–Mitch


#6

Yes, lucky wise step files I receive from designers have all object names assigned to curves and surfaces.
I would guess that the file is sent out after being created in solid works with all components organized into layers and ones I open it on Rhinos-mac it just gets stuffed into one single layer.

I realize that the script is of little help if no name is assigned to it but so far I have been in luck and just want to speed up the process to access information about certain components out of the model.

Thanks a lot for looking into it.

Appreciate it.

Rob


#7

OK, it’s pretty simple then, you can try the script below… Let me know if you need it to do anything different.

ObjectNamesToLayers.py (437 Bytes)


#8

Wonderful, works great.

I can’t thank you enough for your help.

Rob