I’m trying to export a set of layouts as PDFs, and the best way I have found to do this is invoking the Print command in a loop:
var detailsToPrint = doc.Views.GetPageViews();
foreach ( var view in detailsToPrint )
{
view.SetPageAsActive();
RhinoApp.RunScript(String.Format("-Print "), false);
// How to name the file so we don't get stuck here?
}
…but this stalls at the point where the print-to-PDF dialog asks for a destination filename, and I haven’t been able to figure out how to give it one.
Other posts suggest saving the document once manually first to get a default filename, but that didn’t seem to work (it’s still blank in the dialog after saving) and I’d like to find a way to do this without needing to set it up manually beforehand, as I’m developing a plugin.
Update: I was able to get around this by using SendKeys in a worker thread to send the dialog the filename as simulated keyboard input. Gross but works.
It is the best solution for batching pdf I ever found. Thanks a lot!
One question to make the process even more autometic. After runing the script, there will be a window pumps up. Is there a way to simulate “_Enter”, so I don’t need to press the “Okay” buttom? I have tried rs.commond("_Enter"), pynput (gives me error saying it is not for ironPython). Didn’t find a solution…
Can I second this. I am trying to use rhino as my sole architectural software, and I need to batch print vector. Is there a work around or something ? As all exported pdfs in vector coming out wireframe. Note I am using it on linked active models.