I'm having a little trouble exporting sheets to DWF.
It wall works except if the sheet being exported does not have the print setup zoon set to 100% before running my addin the sheets will print to DWF scaled to fit or whatever scale factor it set to. I'm therefor trying to make sure the print zoom scale is set to 100% in my code before calling the export dwf method but its not changing the zoom.
This is my code...
Dim ptManager As PrintManager = uidoc.Document.PrintManager Dim ptSetup As PrintSetup = ptManager.PrintSetup Dim ptParameters As PrintParameters = ptSetup.CurrentPrintSetting.PrintParameters ptParameters.ZoomType = ZoomType.Zoom ptParameters.Zoom = 100 Try ptManager.ViewSheetSetting.Save() Catch ex As Exception End Try Try ptManager.PrintSetup.Save() Catch ex As Exception End Try uidoc.Document.Export(sbIssuePath.ToString, sbFile.ToString, views, DWFExpOpt)
Can someone please point me in the right direction?
The PrintManager class is used to configure for print settings and not for DWF export. Using this class, we can setup a printer and accordingly get access to available paper sizes, zoom level etc.
For DWF Export, as you might have noticed from Revit UI, it uses the Revit DWF Exporter and its settings (including Sheet sizes, and other settings, etc) are typically controlled by the DWFExportOptions. Unfortunately, zoom is not part of this as yet. The Development team is aware of how useful this would be and I hope we get to see this ability to set Zoom programmatically for DWF export soon too.
I've got it working now but yes it would be so much cleaner to have zoom as part of the DWF Export Options.
A PDF Export function would be a bit useful as well
Glad to know that you got the DWF Export piece to work. Thanks for letting me know.
Regarding PDF exports, if you have a PDF Writer Driver installed, we can use the Print Manager API itself and set this driver and export to PDFs.
Hope this helps
yeah well seems to be quite hit and miss printing a sheet to PDF. Trying to print the active view (which would have just been exported to DWG and DWF and sometime the app doesn't think there is a view selected but I can't see why as when I debug and step thjough I always have a view selected.
i'll keep trying