V6 Goal: True PDF Export

Here is how you would export every layout page to a PDF in python

import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs

filename = rs.SaveFileName()
pages = sc.doc.Views.GetPageViews()
pdf = Rhino.FileIO.FilePdf.Create()
dpi = 300
for page in pages:
    capture = Rhino.Display.ViewCaptureSettings(page, dpi)
    pdf.AddPage(capture)
pdf.Write(filename)

Does that work for you?

The ViewCaptureSettings class is the key here. This is where all of the adjustments will be set for producing a page of output. This same class will be used for the upcoming SVG exporter too.

3 Likes