TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: T.Willey on April 11, 2006, 03:01:33 PM

Title: FYI...Paper names
Post by: T.Willey on April 11, 2006, 03:01:33 PM
Just in case anyone was doing a plotting routine, and you want to select the paper from a list that you make.  I had to add an bit of coding to get the usual names shown in the plot dialog.  The original list would return a list of "User123" type paper names.  Once I got that list, I processed it this way to get want is shown in Acad's plot dialog.

Code: [Select]
(vlax-invoke Lo 'GetLocaleMediaName x)

Here is the complete function that I use with help from Alan.

Code: [Select]
(defun GetPaperNames (Lo PlotterFile)
(vlax-invoke Lo 'RefreshPlotDeviceInfo) ; CAB

(if (/= (strcase PlotterFile) (strcase (vla-get-ConfigName Lo)))
 (vla-put-ConfigName Lo PlotterFile)
)
(vlax-invoke Lo 'RefreshPlotDeviceInfo)
(mapcar '(lambda (x) (vlax-invoke Lo 'GetLocaleMediaName x)) (vlax-invoke Lo 'GetCanonicalMediaNames))
)