I need to automate the production of PDF documents as we are heading toward paperless manufacturing. I can use a command string to print, but I’m not sure how to apply the path and filename automatically. I’m wondering if there is a more Pythonish way of doing this?
So basically, in my script I already have the filename prepared to use, and a path defined. I don’t want the user to have to deal with those. But so far, I always get the “Save Print Output As” dialogue to interact with.
Thanks,
Yes, since V6 release seems to be imminent I would say I don’t need to make this work in V5.
Edit: I have it working in V6 now. I used rs.Command (_-Print, blah, blah) but I’m still curious if there is a more Pythonic way of doing this.
Thanks,
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 f…