Message 1 of 15
Not applicable
12-27-2011
02:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to get the various sizes of paper for each printer. I can do this for Windows Printers.
But I also want to get the sizes of the .pc3 files.
So far I have this.
Friend Function GetPaperSizes(ByVal Plotter As String) As StringCollection
For i = 0 To PrinterSettings.InstalledPrinters.Count - 1
ps.PrinterName = PrinterSettings.InstalledPrinters.Item(i)
For j = 0 To ps.PaperSizes.Count - 1
pz = ps.PaperSizes.Item(j)
AcadEdt.WriteMessage(vbLf & pz.PaperName & " w=" & pz.Width * 0.254 & " h=" & pz.Height * 0.254)
Next
Next
Dim p As PlotConfig = PlotConfigManager.SetCurrentConfig(Plotter)
Dim t As String = p.Comment
AcadEdt.WriteMessage(vbLf & t)
Using tr As Transaction = CurDb.TransactionManager.StartTransaction()
Dim lyMgr As LayoutManager = LayoutManager.Current ' Get the current layout
Dim cLayout As Layout = tr.GetObject(lyMgr.GetLayoutId(lyMgr.CurrentLayout), OpenMode.ForRead)
Dim cpInfo As PlotInfo = New PlotInfo() ' Get the PlotInfo from the layout
cpInfo.Layout = cLayout.ObjectId ' Get a copy of the PlotSettings from the layout
Dim cpSet As PlotSettings = New PlotSettings(cLayout.ModelType)
cpSet.CopyFrom(cLayout) ' Update the PlotConfigurationName property of the PlotSettings object
Dim s As String = pl.Comment
' Returns a list of media sizes that are supported for the current device or the PC3 files. (Acad Help)
' except that it always returns ""
Dim cpVdr As PlotSettingsValidator = PlotSettingsValidator.Current
Try
Return cpVdr.GetCanonicalMediaNameList(cpSet)
Catch ex As Exception
Return Nothing
End Try
End Using
End FunctionSo,
I am looking for the various sheet descriptions + width and height.
All help gratefully received.
Solved! Go to Solution.