top of page
  • Writer's pictureDavid Mans

Layer Prefix

💻 Rhino 5

🔼 Rhino Script

🛠️ Visual Basic

 

This Rhino Script allows the user to select multiple layer names and add a prefix to them. It is rather convenient within Rhino since no two layers, including sub-layers, can have the same name.

 
Option Explicit
'Script written by <David Mans>
'Script copyrighted by <NeoArchaic Studio>
'Script version Tuesday, December 02, 2008 9:25:59 AM
 
Call Main()
Sub Main()
    Dim arrLayers,layers, prefix
     
    arrLayers = Rhino.LayerNames(True)
     
    layers = Rhino.MultiListBox(arrLayers, "Select Layers")
    If isNull(layers) Then Exit Sub
     
    prefix = Rhino.StringBox("Type Prefix")
    If isNull(prefix) Then Exit Sub
     
    Dim i
     
    Call Rhino.EnableRedraw(False)
     
    For i = 0 To uBound(layers) Step 1
        Call Rhino.RenameLayer(layers(i), prefix &amp; layers(i))
    Next
     
    Call Rhino.EnableRedraw(True)
End Sub
 


3 views

Recent Posts

See All

Commentaires


bottom of page