Reply
Solved! Go to solution

Export to DWF/DWFx

[ Edited ]

Hi,

 

I have installed a plugin in SolidEdge which exports .dft and .dwg files to .dwf/,dwfx (Autodesk Design Review) file. Just like "Save as PDF".

 

I wrote a small test macro to print the active open dft/dwg file and save it with a new file name. It works fine with few .dft and .dwg files. For few of the files an empty file is saved. i.e., a .dwfx file is created but not geometry in it.

 

I am using the "PrintOut" method from "SolidEdgeDraft.DraftDocument". Below is the line of code and the values. After the code the syntax and paramters of the API from the documentation.

 

Call objDraftDoc.PrintOut("Autodesk DWF Writer for 2D", 1, , , , True, fullFileName, , , True, True)
Public Sub PrintOut( _
   Optional ByVal Printer As Variant, _
   Optional ByVal NumCopies As Variant, _
   Optional ByVal Orientation As Variant, _
   Optional ByVal PaperSize As Variant, _
   Optional ByVal Scale As Variant, _
   Optional ByVal PrintToFile As Variant, _
   Optional ByVal OutputFileName As Variant, _
   Optional ByVal PrintRange As Variant, _
   Optional ByVal Sheets As Variant, _
   Optional ByVal ColorAsBlack As Variant, _
   Optional ByVal Collate As Variant _
) 

Printer 
Defines the name of the printer device. If this argument is not specified, the default printer is used. 

NumCopies 
Defines the number of copies to print. If this argument is not specified, one copy is printed. 

Orientation 
Defines the orientation of the printout and is defined as a Visual Basic PrinterObjectConstants value. If this argument is not specified, the default orientation of the specified printer is used. 

PaperSize 
Defines the preference for paper size. This is defined by selecting a PrinterObjectConstants value from the VBRUN object library supplied with Visual Basic. If it is not specified, the default paper size of the printer is used. 

Scale 
Defines the scale of the plot in decimal form. To print the document at half its size, set Scale to 0.5. To print it at twice its size, set Scale to 2.0. If this argument is not specified, the document is plotted at full scale. If a full-scale plot won't fit on the specified paper size, the document is scaled as needed to fit on the paper. 

PrintToFile 
Set to True to print the referenced document to a file and use the OutputFilename argument to specify the name of the file to which the document is to be printed. If this argument is not specified, the document is printed to the specified printer. 

OutputFileName 
Defines the file name to which the referenced document is to be printed. If the PrintToFile argument is True, then OutputFilename must be specified. If PrintToFile is not specified or is set to False, then OutputFilename is ignored. 

PrintRange 
Defines the method of specifying which sheets to print. This argument only applies when print Draft documents. This is defined by selecting a PrintRangeConstants value. If it is not specified, all sheets in the document are printed. This argument only applies when printing a Draft document. 

Sheets 
Defines the sheets to print when the PrintRange argument is set to igPrintSpecified. If the PrintRange argument is specified as igPrintSpecified, then Sheets must be provided. If the argument PrintRange argument is not specified or is set to something other than igPrintSpecified, then this argument is ignored. This argument only applies when printing a Draft document. For example, to print sheets 1 through 3, sheet 5, and sheets 9 through 10, the String would be "1-3,5,9-10". 

ColorAsBlack 
Specifies to print all colors as black when set to True. If this argument is not specified, colors will be printed as true color on color devices or grayscale on black-and-white devices. 

Collate 
Specifies that all copies are to be collated when set to True. If this argument is not specified, then the copies will not be collated. This argument only applies when printing multiple sheets in a Draft document.

 

Any thoughts/ideas/suggestions would really be helpful.

 

Regards,
Santosh
4 REPLIES

Re: Export to DWF/DWFx

Just out of curiosity, if you manually save as via the GUI, does a valid file get created?

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Export to DWF/DWFx

Yes. A valid file gets generated.
Regards,
Santosh
Solution
Solution
Accepted by topic author santosh0114
‎07-27-2016 07:07 AM

Re: Export to DWF/DWFx

Nothing is jumping out at me as to why it wouldn't work. The only other thing I know to tell you would be to contact GTAC and see if they can help.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Export to DWF/DWFx

Filed a GTAC support request.

Regards,
Santosh