I’m trying to export all the layers in separate files using the attached script.
For some reason it adds “::” character in the file name. Windows can’t save file with “:” in the filename.
I think the problem is strLayer. Can I replace it somehow?
Can anyone please help me?
Thanks!
Hi Yuri, did you write that script yourself? Just put in an extra replace function to convert the : into some other valid character in the strLayer variable before passing that one on to the strFile variable.
The reason the : appears is that the names of sublayers just are strings with a “parent::grandchild” format.
although the problem is solved in the script already, the problem comes from the fact that when Rhino creates layer names it uses a ‘:’ to separate layers and sublayers, so the layer name ends up as comething “layer01:sublayer:finallayer”. So when you convert the layer name to a file name you get problems with the colons in the filename. A simple replace function to trap for colons and spaces usually sorts it out…