Canonical media name vs. Locale name

Canonical media name vs. Locale name

Anonymous
Not applicable
1,239 Views
4 Replies
Message 1 of 5

Canonical media name vs. Locale name

Anonymous
Not applicable
What exactly is the difference between the Canonical Media Name and the
Locale Name and why are there two different ways to specify the name of a
papersize? The documentation IMO, doesn't clear this up, at least for me.

For a batch plot application (VB executable), I need to be able to change
the papersize for the plot. I wrote a little application to printout both
the Canonical media names and Local Media Names for a specific device just
so that I would have a comparable list of the papersizes in both formats.
If I specify the name of the plot using a Canonical Name (eg. User168) I
have no idea what size this is and if I use the Locale Name (eg. Letter), do
I have to convert it back to a canonical name since the property of the page
size is LayoutObject.CanonicalMediaName.


Thanks,

Ryan Small
0 Likes
1,240 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
I'm not sure on this but it's my understanding that the Canonical Media Name
is basically the Windows Standard and the Local Media Name could be whatever
or even translated into another language. This way programmers would know
that they could always find a page size called Letter no matter what
language they user is using. So even though it sounds like the round about
way you do want to get the Canonical Media Names, then their matching Local
names, display the local names to the user, let them select the local name,
convert it back to the canonical name, then set the
layout.canonicalmedianame property.

--
Rodney McManamy - President
MACSolids - Maximizing AutoCAD Solids
website: www.macsolids.com
"Ryan Small" wrote in message
news:2F266C99A6887140CD32E3E0F773F50C@in.WebX.maYIadrTaRb...
> What exactly is the difference between the Canonical Media Name and the
> Locale Name and why are there two different ways to specify the name of a
> papersize? The documentation IMO, doesn't clear this up, at least for me.
>
> For a batch plot application (VB executable), I need to be able to change
> the papersize for the plot. I wrote a little application to printout both
> the Canonical media names and Local Media Names for a specific device just
> so that I would have a comparable list of the papersizes in both formats.
> If I specify the name of the plot using a Canonical Name (eg. User168) I
> have no idea what size this is and if I use the Locale Name (eg. Letter),
do
> I have to convert it back to a canonical name since the property of the
page
> size is LayoutObject.CanonicalMediaName.
>
>
> Thanks,
>
> Ryan Small
>
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
How would that work with non-standard sheet sizes?

Like the original poster, the documentation I've read on this topic is just
plain bizarre, IMO.

Rodney McManamy wrote in message
news:99561FA066E9C0A3D44C17CC8F27CD83@in.WebX.maYIadrTaRb...
> I'm not sure on this but it's my understanding that the Canonical Media
Name
> is basically the Windows Standard and the Local Media Name could be
whatever
> or even translated into another language. This way programmers would know
> that they could always find a page size called Letter no matter what
> language they user is using. So even though it sounds like the round
about
> way you do want to get the Canonical Media Names, then their matching
Local
> names, display the local names to the user, let them select the local
name,
> convert it back to the canonical name, then set the
> layout.canonicalmedianame property.
>
> --
> Rodney McManamy - President
> MACSolids - Maximizing AutoCAD Solids
> website: www.macsolids.com
> "Ryan Small" wrote in message
> news:2F266C99A6887140CD32E3E0F773F50C@in.WebX.maYIadrTaRb...
> > What exactly is the difference between the Canonical Media Name and the
> > Locale Name and why are there two different ways to specify the name of
a
> > papersize? The documentation IMO, doesn't clear this up, at least for
me.
0 Likes
Message 4 of 5

Anonymous
Not applicable
The non standard sizes are considered user sizes and I think they have
canonical media names like User122 or User222 from what I've ben able to
figure.

--
Rodney McManamy - President
MACSolids - Maximizing AutoCAD Solids
website: www.macsolids.com
"TomD" wrote in message
news:5E89894F401829FA8B617462045AEAA4@in.WebX.maYIadrTaRb...
> How would that work with non-standard sheet sizes?
>
> Like the original poster, the documentation I've read on this topic is
just
> plain bizarre, IMO.
>
> Rodney McManamy wrote in message
> news:99561FA066E9C0A3D44C17CC8F27CD83@in.WebX.maYIadrTaRb...
> > I'm not sure on this but it's my understanding that the Canonical Media
> Name
> > is basically the Windows Standard and the Local Media Name could be
> whatever
> > or even translated into another language. This way programmers would
know
> > that they could always find a page size called Letter no matter what
> > language they user is using. So even though it sounds like the round
> about
> > way you do want to get the Canonical Media Names, then their matching
> Local
> > names, display the local names to the user, let them select the local
> name,
> > convert it back to the canonical name, then set the
> > layout.canonicalmedianame property.
> >
> > --
> > Rodney McManamy - President
> > MACSolids - Maximizing AutoCAD Solids
> > website: www.macsolids.com
> > "Ryan Small" wrote in message
> > news:2F266C99A6887140CD32E3E0F773F50C@in.WebX.maYIadrTaRb...
> > > What exactly is the difference between the Canonical Media Name and
the
> > > Locale Name and why are there two different ways to specify the name
of
> a
> > > papersize? The documentation IMO, doesn't clear this up, at least for
> me.
>
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
Tom,

As was stated in some of the earlier messages, the CanonicalMediaName is
basically an internal variable representing the various sheet sizes
available. You can establish the relationship between the two with the
"vla-getlocalemedianame" function.

Assuming that you already have the string for the sheetsize (as displayed in
the plot dialog) assigned to the variable "sht-sz" and have Plot Object set
to the variable "objPlotConfig" this code that I use will tranlate the
sht-sz into the canonicalmedianame and set the value for the plot.

(setq medialist (mapcar '(lambda (x)
(list (vla-getlocalemedianame objPlotConfig
x)
x
) )
(vlax-safearray->list (vlax-variant-value
(vla-getCanonicalMediaNames objPlotConfig)))
) )
(if (or (null sht-sz)
(/= (type sht-sz) 'STR)
(not (setq sht-sz (cadr (car (vl-member-if '(lambda (x)
(wcmatch (strcase
(car x)) (strcase sht-sz))
)
medialist
) ) ) ) ) )
(progn
(alert
(strcat "Invalid or empty SHEET SIZE specified!"
"\nPlotting ABORTED!"
"\n\n" sht-sz
) )
(quit)
)
(vla-put-CanonicalMediaName objPlotConfig sht-sz)
)

"TomD" wrote in message
news:5E89894F401829FA8B617462045AEAA4@in.WebX.maYIadrTaRb...
> How would that work with non-standard sheet sizes?
>
> Like the original poster, the documentation I've read on this topic is
just
> plain bizarre, IMO.
>
> Rodney McManamy wrote in message
> news:99561FA066E9C0A3D44C17CC8F27CD83@in.WebX.maYIadrTaRb...
> > I'm not sure on this but it's my understanding that the Canonical Media
> Name
> > is basically the Windows Standard and the Local Media Name could be
> whatever
> > or even translated into another language. This way programmers would
know
> > that they could always find a page size called Letter no matter what
> > language they user is using. So even though it sounds like the round
> about
> > way you do want to get the Canonical Media Names, then their matching
> Local
> > names, display the local names to the user, let them select the local
> name,
> > convert it back to the canonical name, then set the
> > layout.canonicalmedianame property.
> >
> > --
> > Rodney McManamy - President
> > MACSolids - Maximizing AutoCAD Solids
> > website: www.macsolids.com
> > "Ryan Small" wrote in message
> > news:2F266C99A6887140CD32E3E0F773F50C@in.WebX.maYIadrTaRb...
> > > What exactly is the difference between the Canonical Media Name and
the
> > > Locale Name and why are there two different ways to specify the name
of
> a
> > > papersize? The documentation IMO, doesn't clear this up, at least for
> me.
>
>
>
0 Likes