List layout page names?

Hi folks,
do you think there is any chance to fish out the layout names and list it / export it? I need to create a drawing list and looking for a more convenient way :slight_smile:

Hi @petumatr,

import Rhino
import csv

_exportFilepath = "C:/layoutNames.csv"
_delimiter = ";"  # your local Excel columns delimiter

pageView_L = Rhino.RhinoDoc.ActiveDoc.Views.GetPageViews()
layoutName_L = [pageView.PageName   for pageView in pageView_L]

with open(_exportFilepath, mode='wb') as file:
    csvWriter = csv.writer(file, delimiter=_delimiter, quotechar='"', quoting=csv.QUOTE_MINIMAL)
    csvWriter.writerow(['Index', 'Layout Name'])  # header

    for i in xrange(layoutName_L.Count):
        csvWriter.writerow([str(i+1), layoutName_L[i]])
1 Like

wow, thank you @djordje!!!

1 Like