Hi,
Maybe this can help
;-------------------------------------------------------------GetCanonicalMediaNames--------------
(defun GetCanonicalMediaNames (/ ad)
(setq ad (vla-get-activedocument (vlax-get-acad-object )))
(vla-RefreshPlotDeviceInfo (vla-get-activelayout ad))
(vlax-safearray->list (vlax-variant-value (vla-GetCanonicalMediaNames (vla-item (vla-get-layouts ad) "Model"))))
)
;-------------------------------------------------------------GetLocaleMediaName------------------
(defun GetLocaleMediaName (pd / ad la al)
(setq ad (vla-get-activedocument (vlax-get-acad-object))
la (vla-item (vla-get-layouts ad) "Model")
al (vla-get-activelayout ad)
)
(vla-put-configname al pd)
(princ "\n\n\nSetting:\n")
(princ (showDeviceProp al))
(princ "\n\n\nMedia:\n")
(mapcar '(lambda(mn)(vla-GetLocaleMediaName la mn)) (GetCanonicalMediaNames))
)
;-------------------------------------------------------------GetPlotDevices----------------------
(defun GetPlotDevices (/ ad)
(setq ad (vla-get-activedocument (vlax-get-acad-object)))
(vla-RefreshPlotDeviceInfo (vla-get-activelayout ad))
(vlax-safearray->list (vlax-variant-value (vla-getplotdevicenames (vla-item (vla-get-layouts ad) "Model"))))
)
;-------------------------------------------------------------showDeviceProps----------------------
(defun showDeviceProp (actlay / cusscl Numerator Denominator papmrg LowerLeft UpperRight papsiz Width Height window LLeft URight pltConfigLst)
(setq cusscl (vla-GetCustomScale actlay 'Numerator 'Denominator)
papmrg (vla-GetPaperMargins actlay 'LowerLeft 'UpperRight)
papsiz (vla-GetPaperSize actlay 'Width 'Height)
window (vla-GetWindowToPlot actlay 'LLeft 'URight)
)
(setq pltConfigLst (list (cons "ConfigName" (vla-get-Configname actlay))
(cons "StyleSheet" (vla-get-StyleSheet actlay))
(cons "CanonicalMediaName" (vla-get-CanonicalMediaName actlay))
(cons "CenterPlot" (vla-get-CenterPlot actlay))
(cons "PaperUnits" (vla-get-PaperUnits actlay))
(cons "PlotHidden" (vla-get-PlotHidden actlay))
(cons "PlotRotation" (vla-get-PlotRotation actlay))
(cons "PlotType" (vla-get-PlotType actlay))
(cons "PlotOrigin" (vlax-safearray->list(vlax-variant-value(vla-get-PlotOrigin actlay))))
(cons "PlotWithPlotStyles" (vla-get-PlotWithPlotStyles actlay))
(cons "ScaleLineweights" (vla-get-ScaleLineweights actlay))
(cons "UseStandardScale" (vla-get-UseStandardScale actlay))
(cons "StandardScale" (vla-get-StandardScale actlay))
(cons "Paper Height" height)(cons "Paper Width" Width)
(cons "Margin LowerLeft" (vlax-safearray->list lowerleft))
(cons "Margin UpperRight" (vlax-safearray->list upperright))
(cons "Plot Window Lower Left" (vlax-safearray->list LLeft))
(cons "Plot Window Upper Right" (vlax-safearray->list URight))
(cons "Custom Scale Numerator" numerator)
(cons "Custom Scale Denominator" denominator)
(cons "Custom Scale" (/ denominator numerator)))
)
pltConfigLst
)
;-------------------------------------------------------------c:Test----------------------
;(GetLocaleMediaName "YourDevice.pc3") where "YourDevice.pc3" is a device witch is available from (GetPlotDevices)
(defun c:Test ()
(vl-load-com)
(princ "\nDevices:\n")
(princ (GetPlotDevices))
(GetLocaleMediaName "None")
)
Regards
Harrie