Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Printing to DWF

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
333 Views, 4 Replies

Printing to DWF

I'm working on a small app to print sheets to DWF. So far the only way I've
found to do it is via the DWF Writer print driver. Two issues that I've
encountered:

1. Printing to the DWF Writer causes a warning dialog to pop up stating
that I should be using the native DWF printing capabilities, not the DWF
Writer.

2. Once a DWF is created, the sheet inside the DWF does not have a name.

[code]
PrintManager pm = revit.ActiveDocument.PrintManager;
pm.SelectNewPrintDriver("Autodesk DWF Writer for 2D");
pm.PrintToFileName = @"C:\Test.dwf";
pm.PrintRange = Autodesk.Revit.Enums.PrintRange.Current;
pm.SubmitPrint();
[/code]


Thoughts on circumventing these issues or thoughts on a different way to
print to DWF are all greatly appreciated!

--
Bobby C. Jones
http://bobbycjones.spaces.live.com
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Forgot to mention. I'm trying to get this for 2009, but I'm not opposed to
moving to 2010 if necessary.

--
Bobby C. Jones
http://bobbycjones.spaces.live.com
Message 3 of 5
Anonymous
in reply to: Anonymous

Now I'm thinking that the API isn't there yet and I'll have to resort to
journal scripting. Still fishing for ideas if anybody has one...
--
Bobby C. Jones
http://bobbycjones.spaces.live.com
Message 4 of 5
Anonymous
in reply to: Anonymous

In the end what I really needed was the Document.Export() method. It does
what I need, but there's almost no control over it. It doesn't appear to
use the current Print Setup info. Anyone have any insight into this method?

--
Bobby C. Jones
http://bobbycjones.spaces.live.com
Message 5 of 5
ivan.markov
in reply to: Anonymous



Hi Bobby,



bellow is a code snipet that shows how to use the Export method



if(PrintRange!=Autodesk.Revit.Enums.PrintRange.Select)

{

views.Insert(_commandData.View);

}

else

{

views=_printmanager.ViewSheetSetting.CurrentViewSheetSet.Views;

}

DWF2DExportOptions options=new DWF2DExportOptions();

options.PaperFormat=ExportPaperFormat.Default;

options.PortraitLayout=PrintSetup.Orientation==PageOrientationType.Portrait;

options.ExportObjectData=true;

options.ImageFormat=DWFImageFormat.Lossless;

options.ImageQuality=DWFImageQuality.High;

options.PaperFormat = ExportPaperFormat.ANSI_A;

_commandData.Application

.ActiveDocument

.Export(Path.GetDirectoryName(PrintToFilePath), Path.GetFileName(PrintToFilePath), views, options);

}



The ExportPaperFormat will be whatever size you want to export to. If I need to clearify any of code let me know, i will try to check later if you have mad any comments. Hope that this helps.

Sincerely,
Ivan Edited by: ivan.markov on Nov 9, 2009 7:24 PM

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community