Hello,I wrote a script to rename several layouts with serial names.
now it works,but when I change these layouts print order,
It turned like this:
I reconized that the layouts order in python’s list were sort by create time,
not by print order.
Please teach me how to sort layouts order by print order in a list?
import Rhino import Rhino.Geometry as rg import scriptcontext as sc import rhinoscriptsyntax as rs import math sc.doc = Rhino.RhinoDoc.ActiveDoc def RenameLayootWithSerialName(): layouts = rs.ViewNames(False,1) prefix = rs.GetString("input prefix of layout",False,False) for i in range(len(layouts)): newname = str(prefix)+'-'+str(i+1).zfill(2) rs.RenameView(layouts[i],str(newname)) RenameLayootWithSerialName()