; Return the Plotter configuration name
(defun GetActivePlotDevice ()
(vla-get-ConfigName
(ActLay)
)
)
; Return the Plot style table name
(defun GetActiveStyleSheet ()
(vla-get-StyleSheet
(ActLay)
)
)
; Force the Plotter configuration to something
(defun PutActivePlotDevice (PlotDeviceName)
(vla-put-ConfigName
(ActLay)
PlotDeviceName
)
)
; Force the Plot style table to something
(defun PutActiveStyleSheet (StyleSheetName)
(vla-put-StyleSheet
(ActLay)
StyleSheetName
)
)
; Return a list of all Plotter configurations
(defun PlotDeviceNamesList ()
(vla-RefreshPlotDeviceInfo (ActLay))
(vlax-safearray->list
(vlax-variant-value
(vla-GetPlotDeviceNames
(ActLay)
)
)
)
)
; Return a list of all Plot style tables
(defun PlotStyleTableNamesList ()
(vla-RefreshPlotDeviceInfo (ActLay))
(vlax-safearray->list
(vlax-variant-value
(vla-GetPlotStyleTableNames
(ActLay)
)
)
)
)
; If the saved Plotter configuration doesn't exist set it to None
(defun PutActivePlotDeviceToNoneIfNotExist ()
(if (not (member (GetActivePlotDevice) (PlotDeviceNamesList)))
(PutActivePlotDevice "None")
)
)
; If the saved Plot style table doesn't exist set it to None
(defun PutActiveStyleSheetToNoneIfNotExist ()
(if (not (member (GetActiveStyleSheet) (PlotStyleTableNamesList)))
(PutActiveStyleSheet "")
)
)
; Change the Plotter configuration "Emtunga.pc3" to your need
(defun PutActivePlotDeviceToCompanyStandardIfNotExist ()
(if (not (member (GetActivePlotDevice) (PlotDeviceNamesList)))
(PutActivePlotDevice "Emtunga.pc3")
)
)
; Change the Plot style table "Emtunga-A3-BW.ctb" to your need
(defun PutActiveStyleSheetToCompanyStandardIfNotExist ()
(if (not (member (GetActiveStyleSheet) (PlotStyleTableNamesList)))
(PutActiveStyleSheet "Emtunga-A3-BW.ctb")
)
)
; Change the Plotter configuration to the default one set in the options
; if the active plot device does not exist
(defun PutActivePlotDeviceToDefaultIfNotExistOrNone ()
(if (or (not (member (GetActivePlotDevice) (PlotDeviceNamesList)))
(= (GetActivePlotDevice) "None")
)
(if (= (vla-get-UseLastPlotSettings
(vla-get-output
(vla-get-preferences (vlax-get-acad-object))
)
)
:vlax-true
)
(PutActivePlotDevice
(getenv "General\MRUConfig")
)
(PutActivePlotDevice
(vla-get-DefaultOutputDevice
(vla-get-output
(vla-get-preferences (vlax-get-acad-object))
)
)
)
)
)
)
; Change the Plot style table to the default one set in the options
; if the active Plot style table does not exist
(defun PutActiveStyleSheetToDefaultIfNotExistOrNone ()
(if (or (not
(member (GetActiveStyleSheet) (PlotStyleTableNamesList))
)
(= (GetActiveStyleSheet) "")
)
(PutActiveStyleSheet
(vla-get-DefaultPlotStyleTable
(vla-get-output
(vla-get-preferences (vlax-get-acad-object))
)
)
)
)
)