please excuse my English, its not the best.
I have many rhino-files with many bolts, beams an so on. Each dimension of bolts and so on have a separate name. Now, I want to create a layer for each name. At the moment I have many files with one group, an I don`t want to lose this informations.
Is there a function in Rhino, or do I need a Script or so on?
I hope your can help me very quick. The problem is very urgent.
With best regards
How is the name now associated with the objects - is it just the object name? If so, it is possible to make a script that takes each object, grabs its name, makes a new layer with the same name and puts the object on that layer. Is that what you need?
yes, its just the object name. Your description is exactly what I need. But unfortunately I don`t have any experience with scripting.
OK, you can try the attached script... For each of the objects selected it will create a new layer with the object's name - if the layer doesn't exist already - and put the object on it. For any object that does not have a name, nothing will be done. Easiest way to test it out is to open the script editor in Rhino (type _EditScript) and then open the script from there. Then press the run button at the top. If you are going to use this often, I can help you create a toolbar button or alias for it.
I followed your description, but nothing happened.
I activate everything ( 153 polysurfaces and 7 block instances) and run the script, without any result.
Yes, we got a very big project and for this, I`ll often nead this script. So if you could help me with an tool bar-butten, it would be great!
attached you find some parts of my file. I had no success with it.
The problem is in your part naming convention. Your parts all start with a number in parentheses : (#47368) 0823-SPA-001_ASM. Unfortunately, Rhino layer names cannot start with parentheses... So, I could modify the script to remove the parentheses for the layer name, remove the entire number plus the parentheses, or I could add another accepted character (letter or number) in front... What would you like?
Okay, I can understand that.
I think we should foget the number in parentheses. The information right behind this is interesting for me. How could we realize a butten in the toolbar? I select some objects, and press the button, and the script runs in the background? That would be great and very easy. I could create all the layers very fast.
OK, here is a new version to try out. This version will look to see if the object name starts with an open parentheses, if it does it looks for a close parentheses, if it finds that, it removes everything in between. If it finds an open parentheses at the start but no close after, it just removes the open parentheses.
Now, to make this version work in a toolbar button:
There is a small description here, although it is for V4. Basically, you need to create a new button in a toolbar, then open the button editor for that button. In the Macro box, type the following:
! _NoEcho -_Runscript (
Then, open the script file in a text editor,
and copy/paste the entire script in just after that on the next line.
Then type a close parentheses on a new line *after* the entire script.
Then OK and close out of the button editor. Your script should then work in the button.
ok, its nearly perfect, the script creates the layers, but the layers are all empty. The last step shoult move the elements to the right layer.
Is that possible?
Thanks al lot!
Sorry, that was just a typing mistake - try the attached instead...
Thank you very much!
This script is so useful for me! Tomorrow I`ll try to make the button and then its incredible!
Thanks for this perfect support!