Bug with Paper Size ?

Bug with Paper Size ?

Anonymous
Not applicable
306 Views
5 Replies
Message 1 of 6

Bug with Paper Size ?

Anonymous
Not applicable
Hi, I'm having a problem when selecting the paper size in VBA. Every time I select a paper size "CanonicalMediaName" the correct paper size is selected, but the printable area is not correct (is larger than it should be). For example, If I select the paper size "A1" from the plot Dialogue box it shows the correct printable area 830 x 560, but when selected from the code It will show it as 841x594. This problem happens to different paper sizes & different printers as well. Is this a Bug......

Thanks

Marcelo
0 Likes
307 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
from previous post here:-thanks to mark sanchez
quote:

To find out what the actual Canonical media name is for your custom paper
size, try running the following "GetMedia" function. This will print out all
Canonical and Locale media names to the Immediate window. Make sure to enter
your specific plot config (PC3) file name where noted below:

Public Sub GetMedia()

Dim strMedia() As String, strPaperSize As String, strLocaleSize As String
Dim intI As Integer
Dim objPlotConfig As AcadPlotConfiguration

strPaperSize = vbNullString
strLocaleSize = vbNullString

Set objPlotConfig = ThisDrawing.PlotConfigurations.Add("NEW", True)

If Not objPlotConfig Is Nothing Then
'Enter your PC3 file name HERE:
objPlotConfig.ConfigName = "YourPlotConfigNameHere.PC3"
objPlotConfig.RefreshPlotDeviceInfo
strMedia() = objPlotConfig.GetCanonicalMediaNames
End If

For intI = 0 To UBound(strMedia)
strPaperSize = strPaperSize & strMedia(intI) & " "
strLocaleSize = strLocaleSize &
objPlotConfig.GetLocaleMediaName(strMedia(intI)) & "**"
Next

Debug.Print strPaperSize
Debug.Print "******"
Debug.Print strLocaleSize

ThisDrawing.PlotConfigurations("NEW").Delete
Set objPlotConfig = Nothing

End Sub

Hope this helps,

Mark Sanchez

"marceloc" wrote in message
news:f198c77.-1@WebX.maYIadrTaRb...
> Hi, I'm having a problem when selecting the paper size in VBA. Every time
I select a paper size "CanonicalMediaName" the correct paper size is
selected, but the printable area is not correct (is larger than it should
be). For example, If I select the paper size "A1" from the plot Dialogue box
it shows the correct printable area 830 x 560, but when selected from the
code It will show it as 841x594. This problem happens to different paper
sizes & different printers as well. Is this a Bug......
> Thanks
>
> Marcelo
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks for that, but that is not the problem. I select the right name, but the printable area in wrong, Is likeit does not get the margins off the printer...
0 Likes
Message 4 of 6

Anonymous
Not applicable
so you're calling .RefreshPlotDeviceInfo before trying to get the size,
right?


"marceloc" wrote in message
news:f198c77.1@WebX.maYIadrTaRb...
> Thanks for that, but that is not the problem. I select the right name, but
the printable area in wrong, Is likeit does not get the margins off the
printer...
0 Likes
Message 5 of 6

Anonymous
Not applicable
I consider it to be a bug... there's been a lot of discussion about it that
may help you get what you need done...

http://groups.google.com/groups?q=paper+size+group:autodesk.autocad.customization.vba
http://groups.google.com/groups?q=margins+group:autodesk.autocad.customization.vba
http://groups.google.com/groups?q=plot+offset+group:autodesk.autocad.customization.vba

HTH,
James
0 Likes
Message 6 of 6

Anonymous
Not applicable
yes I'm using .RefreshPlotDeviceInfo

Thanks for those links, looks like it is a bug. Looks like there is a few ways around it (ugly ways).

Thanks for your help.

Marcelo
0 Likes