Plot Different Paper Sizes to Same Printer ??

Plot Different Paper Sizes to Same Printer ??

Anonymous
Not applicable
503 Views
3 Replies
Message 1 of 4

Plot Different Paper Sizes to Same Printer ??

Anonymous
Not applicable
I want to create a plot program using VBA in R2000 (Model Space plotting
only) but am having difficulty selecting different paper sizes for the same
printer. One of my available printers is an HP Design Jet ColorPro Cad
network printer. Under Document Defaults, the orientation is portrait.
The paper size is set to ANSI B - 11x17 in. The paper source is Tray 3.

I am having success specifying different printers, but have not been able to
select and print using the paper size ANSI A - 8.5x11 for the HP Design Jet
ColorPro Cad. I am able to plot the 11x17 paper size without problems. The
strange thing is that if do:

ThisDrawing.Plot.DisplayPlotPreview acFullPreview

the preview appears to be using the correct paper size be it 8.5x11 or
11x17. I am also able to print through AutoCad with the correct paper size.
I saw a thread from Michael LaQuire describing a similar problem with R14

This is the code I use to change paper size:

ThisDrawing.ActiveLayout.CanonicalMediaName = "ANSI A - 8 1/2 x 11 in."

How can I print using different paper sizes to the same printer?

Thanks for any help.

Chris
0 Likes
504 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Test in the Plot dialog if the papersize you want is selectable. If so then
verify if you use the right string for this papersize with Debug.Print
ActiveLayout.CanonicalMediaName.

Hope this helps,
--
Henk

CadFancy - Adventures in Visual Basic
www.CadFancy.myweb.nl
0 Likes
Message 3 of 4

Anonymous
Not applicable
Henk

This is the actual code I am testing:

Public Sub test()
Dim mediaNames As Variant
Dim strMyPaper As String
Dim strPsize As String
Dim X As Integer

ThisDrawing.ActiveLayout = ThisDrawing.Layouts("Model")
ThisDrawing.ActiveLayout.ConfigName = "\\BBS\HP DesignJet 11x17"
strPsize = "ANSI A - 8 1/2 x 11 in."

mediaNames = ThisDrawing.ActiveLayout.GetCanonicalMediaNames()
For X = LBound(mediaNames) To UBound(mediaNames)
If strPsize = ThisDrawing.ActiveLayout.GetLocaleMediaName(mediaNames(X))
Then
strMyPaper = mediaNames(X)
End If
Next
ThisDrawing.ActiveLayout.CanonicalMediaName = strMyPaper

ThisDrawing.ActiveLayout.PlotType = acExtents
ThisDrawing.ActiveLayout.StandardScale = acScaleToFit
ThisDrawing.ActiveLayout.CenterPlot = True
ThisDrawing.ModelSpace.Layout.PlotRotation = 0
ThisDrawing.ActiveLayout.StyleSheet = "monochrome.ctb"

'ThisDrawing.Plot.DisplayPlotPreview acFullPreview

ThisDrawing.Plot.PlotToDevice "\\BBS\HP DesignJet 11x17"

End Sub

My plots continue to come out on the 11x17 size paper. If I plot through
Autocad, I am able to select the 8 1/2x11 size paper and plot to it
correctly.

If I choose:
'ThisDrawing.Plot.DisplayPlotPreview acFullPreview

instead of:
ThisDrawing.Plot.PlotToDevice "\\BBS\HP DesignJet 11x17"

the preview uses the correct paper size. Any other ideas?

Thanks

Chris

Henk Loonstra wrote in message
news:CE954438FE1A8EE38AE10141A3C36C9B@in.WebX.maYIadrTaRb...
> Test in the Plot dialog if the papersize you want is selectable. If so
then
> verify if you use the right string for this papersize with Debug.Print
> ActiveLayout.CanonicalMediaName.
>
> Hope this helps,
> --
> Henk
>
> CadFancy - Adventures in Visual Basic
> www.CadFancy.myweb.nl
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
I can't look in your computer if the strPsize corresponds with the
CanonicalMediaName. Try debug de code with a break at the code where you
think it goes wrong and check all the variables step by step.

--
Henk

CadFancy - Adventures in Visual Basic
www.CadFancy.myweb.nl
0 Likes