Author Topic: GetCanonicalMediaNames returns inconsistent paper size  (Read 1632 times)

0 Members and 1 Guest are viewing this topic.

meinfilel

  • Mosquito
  • Posts: 1
GetCanonicalMediaNames returns inconsistent paper size
« on: September 01, 2023, 03:00:20 AM »
Hello, everyone,

 

I've found the following code online and tried to get the paper sizes I'vw created for my custom printing. I've noticed that for some of the papers the command GetCanonicalMediaNames returns wrong numbers; I mean that when inspecting the paper size from plotter manager you get different number than the one returned by the command. Have anyone else noted this behaviour?

 

For example the paper with name "Viva_Print_Katopseis" is 609x655mm while the code returns its size as 609x860mm. Same with "anagnwstaki_topografiko" (609x846 from printer configuration windows vs. 609x900 from the command).

 

I'm attach my .pc3 file hoping it'll make my problem more clear and easier for you to assist me.

 

Thanks in advance!

Code: [Select]
setvar 'tilemode 0)
(setq AcadObj (vlax-get-Acad-Object))
(setq FilesObj (vla-get-Files (vla-get-Preferences AcadObj)))
(setq ActLo (vla-get-ActiveLayout (vla-get-ActiveDocument AcadObj)))

 
(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vlax-put ActLo 'ConfigName "DWG to PDF.pc3")                        ; Plotter Name
    (setq    paperList
        (mapcar '(lambda (x) (cons (vlax-invoke ActLo 'GetLocaleMediaName x) x))
        (vlax-invoke ActLo 'GetCanonicalMediaNames)
        )
    )

BIGAL

  • Swamp Rat
  • Posts: 1434
  • 40 + years of using Autocad
Re: GetCanonicalMediaNames returns inconsistent paper size
« Reply #1 on: September 01, 2023, 08:50:02 PM »
Possible answer at Cadtutor.
A man who never made a mistake never made anything