Jump to content

GetCanonicalMediaNames inconsint paper size


meinfilel

Recommended Posts


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!


 

(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)
        )
    )

 

my_pc3.zip

Link to comment
Share on other sites

Just a comment do you need to get the media sizes at all ? We had a few PLOT lisp's each hard coded with the correct paper size. That was used in a Plot sequence to plot layouts.

 

(COMMAND "-PLOT"  "Y"  "" "dwg to Pdf"
	       "ISO A0 (841.00 x 1189.00 MM)" "m" "LANDSCAPE"  "N"   "E"  "F"  "C"
	       "y" "Acad.ctb" "Y"	"n" "n" "n" pdfName "N" "y"
    )

You could choose your paper size from a list of sizes see my Multi Radio Buttons.lsp. The main thing is to get a full correct name of the sheet size. When you plot manually look at the sheet size you need to exactly match including spaces or special characters. Even text case. So replace "ISO A0 (841.00 x 1189.00 MM)" with variable sheetname.

 

Sounds also like the Landscape & portrait settings are back to front in your Pc3. You may have Y & X instead of X & Y

Edited by BIGAL
Link to comment
Share on other sites

Thanks for your response.

 

My plots are never standard size (one time i need 860mm the next time 858mm etc) so I want to list all available paper sizes to check if I can select one that exists or I need to make a completely new one.

 

Regarding X and Y, would that cause the difference I noted?

 

Another interesting thing I just found is that when decompressing .pmp (using https://github.com/avbrakel/unzip_pc3) i see this 

14{
    caps_type=2
    name="UserDefinedMetric (609.00 x 860.00MM)
    localized_name="Viva_Print_Katopseis
    media_description_name="UserDefinedMetric Portrait 609.00W x 860.00H - (0, 0) x (609, 860) =523740 MM_1_2
    media_group=15
    landscape_mode=FALSE
   }

 

but when checking size from plotter I get a different dimension 

image.thumb.png.b4abdb37b5c89cf5bf8a9e849ca59f4a.png

 

Is there an explanation for that? Thanks again!

 

I'm attaching the decoded txt of my .pmp file.

 

DWG To PDF.pmp.txt

Link to comment
Share on other sites

There was a solution to your request over at Forums/autodesk, it answered the question of various sheet sizes.  It was a lengthy response, sorry that's about all I can help with, post your question over there.

 

A question WHY are you using various sheet sizes is not your sheet of paper fixed ?

Link to comment
Share on other sites

8 hours ago, BIGAL said:

There was a solution to your request over at Forums/autodesk, it answered the question of various sheet sizes.  It was a lengthy response, sorry that's about all I can help with, post your question over there.

 

A question WHY are you using various sheet sizes is not your sheet of paper fixed ?

Thanks, I'm gonna search it.

 

Only one dimension is fixed (the width of the canon printer). Length usually varies mainly because of maps attached to the drawing each time.

Link to comment
Share on other sites

Ok the answer is make some standard sizes, why make a new size to save 20 mm of paper. make say sizes with 50 mm steps you only have to do once. Even the code I talked about just found the size to suit but you have to make each sheet size. Its just one of those things.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...