Greetings,
I am attempting to expedite the pdf export process from Rhino but am running into a snag where I first need to run:
RhinoDoc.OpenFile(3dmPath);
doc = RhinoDoc.ActiveDoc;
On each and every file before I can export the pdf. Is it possible to utilize the Rhino.FileIO.FilePdf.Create() function without opening every single document and setting the active document?
I have the following code that returns an IList of Rhino.DocObjects.ViewInfo objects. But I cannot convert the ViewInfo object into a Rhino.Display.PageView type object needed for Rhino.FileIO.FilePdf.Create()
private static List<string> STANDARD_VIEWS = new List<string>()
{ "Top", "Bottom", "Left", "Right", "Front", "Back", "Perspective" };
public static IList<Rhino.DocObjects.ViewInfo> GetPageViews(string path)
{
var layouts = new List<Rhino.DocObjects.ViewInfo>();
// make sure the template file exists //
if (System.IO.File.Exists(path) == false) { return layouts; }
// read rhino file //
Rhino.FileIO.File3dm file = Rhino.FileIO.File3dm.Read(path);
// loop through files and remove standard views //
foreach (Rhino.DocObjects.ViewInfo view in file.Views)
{
if (STANDARD_VIEWS.Contains(view.Name) == false)
layouts.Add(view);
}
return layouts;
}
Is it possible to convert the ViewInfo type object into a PageView so a PDF can be printed?
This would allow pdfs from multiple files to be printed without first opening each file and would hopefully speed up the process.
Once the file is open it is possible to properly setup Rhino.Display.ViewCaptureSettings(), but I cannot seem to do it without the file being first opened as the active doc.
Has anyone been able to successfully print a pdf without opening the file?
@stevebaer ?
Thanks,