Revit API

Reply
Valued Contributor
russ.green
Posts: 78
Registered: ‎02-27-2010
Message 1 of 5 (371 Views)

Exporting to DWF

371 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
Employee
saikat
Posts: 185
Registered: ‎08-16-2007
Message 2 of 5 (347 Views)

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

Valued Contributor
russ.green
Posts: 78
Registered: ‎02-27-2010
Message 3 of 5 (339 Views)

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
Employee
saikat
Posts: 185
Registered: ‎08-16-2007
Message 4 of 5 (329 Views)

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

Valued Contributor
russ.green
Posts: 78
Registered: ‎02-27-2010
Message 5 of 5 (322 Views)

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Revit

Twitter

Facebook

Blogs

Youtube