Actual papersize?

Actual papersize?

scowsert
Enthusiast Enthusiast
1,016 Views
4 Replies
Message 1 of 5

Actual papersize?

scowsert
Enthusiast
Enthusiast
I can get the current paper size name with this.
(SETQ SIZE (VLA-GET-CANONICALMEDIANAME (VLA-GET-ACTIVELAYOUT (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))))

How can I get the actual dimensions of that papersize and not just the name?
0 Likes
1,017 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
(vla-GetPaperSize
(vla-Get-ActiveLayout
(vla-Get-ActiveDocument
(vlax-Get-Acad-Object))))

--
R. Robert Bell


wrote in message news:5206796@discussion.autodesk.com...
I can get the current paper size name with this.
(SETQ SIZE (VLA-GET-CANONICALMEDIANAME (VLA-GET-ACTIVELAYOUT
(VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))))

How can I get the actual dimensions of that papersize and not just the name?
0 Likes
Message 3 of 5

scowsert
Enthusiast
Enthusiast
Ultimately I'd like to get all actual papersizes available from a plotter. I can get all the papersize names available. Is there a way I can extract the actual size based on the papername?
0 Likes
Message 4 of 5

Anonymous
Not applicable
I've never bothered. Perhaps someone that has will reply.

--
R. Robert Bell


wrote in message news:5206858@discussion.autodesk.com...
Ultimately I'd like to get all actual papersizes available from a plotter. I
can get all the papersize names available. Is there a way I can extract the
actual size based on the papername?
0 Likes
Message 5 of 5

Anonymous
Not applicable
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
0 Likes