Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Posts: 196
Registered: ‎03-25-2011
Message 1 of 2 (239 Views)
Accepted Solution

Confusion regarding Layout info, plot device, and GetCanonicalMediaNames

239 Views, 1 Replies
04-24-2012 09:05 AM

I'm exploring how to use Visual Lisp to specify a specific plot configuration if it isn't already specified; but, I am confused by the information I am getting from GetCanonicalMediaNames.  The specified device "TIFF Version 6 (CCITT G4 2D Compression).pc3" has several user defined custom paper sizes but none of them are included in the list of Canonical Media Names:  Some have the same pixel dimensions but not all of the "UserDefinedRaster" pixel dimensions match paper sizes I've added.  Most notably the one size I use the most which I named "34x22 288dpi (9792,00 x 6336.00 Pixels)" is absent.


What is the connection between the paper sizes I am getting and the paper sizes that exist in the .pc3 file, if any?

Where are these GetCanonicalMediaNames paper sizes coming from?


Here is what I am getting from GetCanonicalMediaNames for my "TIFF Version 6 (CCITT G4 2D Compression).pc3" device:

  UserDefinedRaster (12906.00 x 8640.00Pixels)

  UserDefinedRaster (8640.00 x 6912.00Pixels)

  UserDefinedRaster (4896.00 x 6336.00Pixels)

  UserDefinedRaster (3168.00 x 2448.00Pixels)

  UserDefinedRaster (7776.00 x 5184.00Pixels)

  UserDefinedRaster (6336.00 x 4896.00Pixels)

  UserDefinedRaster (9072.00 x 6480.00Pixels)




Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989
Windows 7 Professional 64-bit - Service Pack 1
Intel﴾R﴿ Core﴾TM﴿ i7-3820 CPU 3.60GHz; 16 GB DDR3 Dual Channel RAM
nVidia Quadro 4000; AutoCAD Civil 3D 2014, sp1
New Member
Posts: 1
Registered: ‎05-08-2012
Message 2 of 2 (212 Views)

Re: Confusion regarding Layout info, plot device, and GetCanonicalMediaNames

05-08-2012 06:28 PM in reply to: coopdetat



Use vla-GetLocaleMediaName to get the paper sizes as you have saved them for the printer.

I use the following code:


;gets the paper sizes for the plotter/layout
    (setq canon_size (vlax-safearray->list(vlax-variant-value(vla-GetCanonicalMediaNames (alay)))))
    ;gets the local paper sizes for the printer
      (foreach ps canon_size
        (setq paper_size (cons (vla-GetLocaleMediaName (alay) ps) paper_size))
    );end for


where (alay) is the current active layout, paper_size will be a list containing all of the paper as you have named them.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community