Printing active view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm writing a drawing issue tool and having troubles with my PDF printing to PDFCreator.
Basically my addin loops through the sheets to be issued then for each sheet exports DWG, DWF, prints to PDF and will also print.
DWG and DWF exporting all OK with the activeview but printing is hit and miss. does not always detect the active view.
Dim thisdoc As Document = uidoc.Document
Using trans As New Transaction(doc, "Export Sheets")
trans.Start()
If Me.chkExportDWG.Checked = True Then ExportDWG(sbFile.ToString & ".dwg")
If Me.chkExportDWF.Checked = True Then ExportDWF(sbFile.ToString & ".dwf", GetSheetsize(sheet, doc), thisdoc)
If Me.chkExportPDF.Checked = True Then ExportPDF(sbFile.ToString & ".pdf", sheet.SheetNumber, thisdoc, thisdoc.ActiveView)
If Me.chkPrint.Checked = True Then PrintSheet(sheet, thisdoc)
trans.Commit()
End Using
Private Sub ExportPDF(ByVal ExportFileName As String, ByRef sheetnumber As String, ByRef thisdoc As Document, ByRef thisview As Autodesk.Revit.DB.View)
'handle page setups etc
ptManager.SubmitPrint(thisview)
end sub
Now when I debug thisview exists but I sometimes get an error that no views are selected. Any advice here would be a big help....
Russ