• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Revit API

    Reply
    Valued Contributor
    Posts: 67
    Registered: ‎02-27-2010

    Exporting to DWF

    218 Views, 4 Replies
    09-30-2012 01:05 AM

    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?

     

    Thanks

    Russ Green
    Please use plain text.
    Employee
    saikat
    Posts: 181
    Registered: ‎08-16-2007

    Re: Exporting to DWF

    10-05-2012 04:40 PM in reply to: russ.green

    Hi Russ

     

    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.

     

    cheers



    Saikat Bhattacharya

    Please use plain text.
    Valued Contributor
    Posts: 67
    Registered: ‎02-27-2010

    Re: Exporting to DWF

    10-06-2012 12:48 AM in reply to: russ.green

    thanks.

     

    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 :smileyhappy:

     

    Russ

    Russ Green
    Please use plain text.
    Employee
    saikat
    Posts: 181
    Registered: ‎08-16-2007

    Re: Exporting to DWF

    10-07-2012 11:38 PM in reply to: russ.green

    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



    Saikat Bhattacharya

    Please use plain text.
    Valued Contributor
    Posts: 67
    Registered: ‎02-27-2010

    Re: Exporting to DWF

    10-08-2012 05:46 AM in reply to: russ.green

    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

    Russ Green
    Please use plain text.