vla-GetLocaleMediaName to find current local paper size?

vla-GetLocaleMediaName to find current local paper size?

Anonymous
Not applicable
744 Views
3 Replies
Message 1 of 4

vla-GetLocaleMediaName to find current local paper size?

Anonymous
Not applicable
I have used vla-GetLocaleMediaName to retrieve all available paper sizes
from the current printer (using Jimmy B's code from thread "Paper Size of
Selected Printer??" posted on September 13, 2000) and I have used
vl-registry-read to get the key from MRUConfig which appears to give me the
name of the current printer. However I have not found a way to retrieve
what the current paper size is actually set to. I would like to use the
local media name so I don't end up with things like "user1" which are not as
friendly. I've also looked at using the PLOTSETTINGS group codes but had
little success there as well. I'm using 2000i on NT4 & 2000 workstations
and I'm trying to update my plot logging utility I wrote for R14. The built
in plot logging utility for 2000i does not provide a job number (which I
just extract from the directory that the file is in) and we use HP 5000
printers which apparently don't get along with that version of plot log
anyway (HP & Autodesk knowledge bases say to turn plot logging off when
using a HP 5000 printer).



Any help is much appreciated!



Jerry Griffin
0 Likes
745 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
(setq acada (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acada))
(setq ActLayout (vla-get-ActiveLayout doc))
(vla-getpapersize ActLayout 'width 'height) ;get layout width and height
(setq w1 (itoa (fix (/ width 25.4)))) ;width converted to inches
(setq h1 (itoa (fix (/ height 25.4)))) ;height converted to inches

CJ

"Jerry Griffin" wrote in message
news:F1F82CB5CF5836DC3FF0F3C7A67DD574@in.WebX.maYIadrTaRb...
> I have used vla-GetLocaleMediaName to retrieve all available paper sizes
> from the current printer (using Jimmy B's code from thread "Paper Size of
> Selected Printer??" posted on September 13, 2000) and I have used
> vl-registry-read to get the key from MRUConfig which appears to give me
the
> name of the current printer. However I have not found a way to retrieve
> what the current paper size is actually set to. I would like to use the
> local media name so I don't end up with things like "user1" which are not
as
> friendly. I've also looked at using the PLOTSETTINGS group codes but had
> little success there as well. I'm using 2000i on NT4 & 2000 workstations
> and I'm trying to update my plot logging utility I wrote for R14. The
built
> in plot logging utility for 2000i does not provide a job number (which I
> just extract from the directory that the file is in) and we use HP 5000
> printers which apparently don't get along with that version of plot log
> anyway (HP & Autodesk knowledge bases say to turn plot logging off when
> using a HP 5000 printer).
>
>
>
> Any help is much appreciated!
>
>
>
> Jerry Griffin
>
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks! This will work very well for me.


"CJ Follmer" wrote in message
news:DB1EBD4F9070A8B12F87E4BB578CF495@in.WebX.maYIadrTaRb...
> (setq acada (vlax-get-acad-object))
> (setq doc (vla-get-ActiveDocument acada))
> (setq ActLayout (vla-get-ActiveLayout doc))
> (vla-getpapersize ActLayout 'width 'height) ;get layout width and height
> (setq w1 (itoa (fix (/ width 25.4)))) ;width converted to inches
> (setq h1 (itoa (fix (/ height 25.4)))) ;height converted to inches
>
> CJ
>
> "Jerry Griffin" wrote in message
> news:F1F82CB5CF5836DC3FF0F3C7A67DD574@in.WebX.maYIadrTaRb...
> > I have used vla-GetLocaleMediaName to retrieve all available paper sizes
> > from the current printer (using Jimmy B's code from thread "Paper Size
of
> > Selected Printer??" posted on September 13, 2000) and I have used
> > vl-registry-read to get the key from MRUConfig which appears to give me
> the
> > name of the current printer. However I have not found a way to retrieve
> > what the current paper size is actually set to. I would like to use the
> > local media name so I don't end up with things like "user1" which are
not
> as
> > friendly. I've also looked at using the PLOTSETTINGS group codes but
had
> > little success there as well. I'm using 2000i on NT4 & 2000
workstations
> > and I'm trying to update my plot logging utility I wrote for R14. The
> built
> > in plot logging utility for 2000i does not provide a job number (which I
> > just extract from the directory that the file is in) and we use HP 5000
> > printers which apparently don't get along with that version of plot log
> > anyway (HP & Autodesk knowledge bases say to turn plot logging off when
> > using a HP 5000 printer).
> >
> >
> >
> > Any help is much appreciated!
> >
> >
> >
> > Jerry Griffin
> >
> >
>
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
I didn't quite understand the question. Do you want to know the width and
height of the paper as CJ wrote or the name of the paper size which tells
you the dims?
If you want the paper size per the local name of the paper assigned to the
active layout
(setq actdoc (vla-get-ActiveDocument (vlax-get-Acad-Object))
actlay (vla-get-ActiveLayout actdoc)
)
(vla-RefreshPlotDeviceInfo actlay)
(setq localname (vla-GetLocaleMediaName actlay (vla-get-CanonicalMediaName
actlay)))

"Jerry Griffin" wrote in message
news:EF76005D4FD9928DC21A2875EBDAD057@in.WebX.maYIadrTaRb...
> Thanks! This will work very well for me.
>
>
> "CJ Follmer" wrote in message
> news:DB1EBD4F9070A8B12F87E4BB578CF495@in.WebX.maYIadrTaRb...
> > (setq acada (vlax-get-acad-object))
> > (setq doc (vla-get-ActiveDocument acada))
> > (setq ActLayout (vla-get-ActiveLayout doc))
> > (vla-getpapersize ActLayout 'width 'height) ;get layout width and
height
> > (setq w1 (itoa (fix (/ width 25.4)))) ;width converted to inches
> > (setq h1 (itoa (fix (/ height 25.4)))) ;height converted to inches
> >
> > CJ
> >
> > "Jerry Griffin" wrote in message
> > news:F1F82CB5CF5836DC3FF0F3C7A67DD574@in.WebX.maYIadrTaRb...
> > > I have used vla-GetLocaleMediaName to retrieve all available paper
sizes
> > > from the current printer (using Jimmy B's code from thread "Paper Size
> of
> > > Selected Printer??" posted on September 13, 2000) and I have used
> > > vl-registry-read to get the key from MRUConfig which appears to give
me
> > the
> > > name of the current printer. However I have not found a way to
retrieve
> > > what the current paper size is actually set to. I would like to use
the
> > > local media name so I don't end up with things like "user1" which are
> not
> > as
> > > friendly. I've also looked at using the PLOTSETTINGS group codes but
> had
> > > little success there as well. I'm using 2000i on NT4 & 2000
> workstations
> > > and I'm trying to update my plot logging utility I wrote for R14. The
> > built
> > > in plot logging utility for 2000i does not provide a job number (which
I
> > > just extract from the directory that the file is in) and we use HP
5000
> > > printers which apparently don't get along with that version of plot
log
> > > anyway (HP & Autodesk knowledge bases say to turn plot logging off
when
> > > using a HP 5000 printer).
> > >
> > >
> > >
> > > Any help is much appreciated!
> > >
> > >
> > >
> > > Jerry Griffin
> > >
> > >
> >
> >
>
>
0 Likes