| Author |
Message |
per
Guest
|
Posted:
Wed Dec 29, 2004 9:47 pm Post subject:
Listing of Page setup and/or output devices |
|
|
Hi there,
I am looking for a way within VisualLISP to extract a list of Page setups
within a drawing and/or a list of available output print devices. If there
is someone with the knowledge to help me out, I would greatly appreciate it.
Thank you in advance for your help.
--
Phillip
|
|
| Back to top |
|
 |
pablorico21
Guest
|
Posted:
Thu Dec 30, 2004 8:33 pm Post subject:
Re: Listing of Page setup and/or output devices |
|
|
It's a idea, this routine bellow find the main printter installed in Pc:
(DEFUN PRINTTER_FROM_PC (/ ACFROMC PRINTTERS_IN_THIS_PC PRINTTERS_IN_THIS_PC PRINTTER_L
PRINTTERS_FINAL)
(SETQ ACFROMC (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))
(SETQ PRINTTERS_IN_THIS_PC
(VLAX-SAFEARRAY->LIST
(VLAX-VARIANT-VALUE
(VLA-GETPLOTDEVICENAMES (VLA-GET-ACTIVELAYOUT ACFROMC)))))
(FOREACH PRINTTER_L PRINTTERS_IN_THIS_PC
(IF (AND (NOT (WCMATCH PRINTTER_L "*.pc3")) (/= PRINTTER_L "None"))
(SETQ PRINTTERS_FINAL (CONS PRINTTER_L PRINTTERS_FINAL))))
(car PRINTTERS_FINAL))
;----------------------------------------- |
|
| Back to top |
|
 |
Jason Piercey
Guest
|
Posted:
Thu Dec 30, 2004 8:53 pm Post subject:
Re: Listing of Page setup and/or output devices |
|
|
Phillip,
Here are some toolbox functions that I use. The first
one will get the names of the pagesetups defined in the
specified document, the other three are used to get
the plot device information (IIRC, the functions for
plot devices came from Doug Broad)
; function to determine what plotconfigurations
; are defined in the specified document
; [document] - document object
; return: list of strings or nil
; (getPlotConfigNames (vla-get-activedocument (vlax-get-acad-object)))
(defun getPlotConfigNames (document / names)
(reverse
(vlax-for x (vla-get-plotconfigurations document)
(setq names (cons (vla-get-name x) names))
)
)
)
; obtain a list of available printers/plotters
; return: list of strings or nil
(defun getPlotDevices (/ hide layout)
(if (setq hide (= "1" (getenv "HideSystemPrinters")))
(setenv "HideSystemPrinters" "0") )
(setq
layout
(vla-get-activelayout
(vla-get-activedocument
(vlax-get-acad-object))))
(vla-refreshplotdeviceinfo layout)
(if hide (setenv "HideSystemPrinters" "1"))
(vlax-invoke layout 'getplotdevicenames)
)
; retrieve a list of .pc3 devices
; file dependencies
; getPlotDevices.lsp
(defun getPC3Devices (/ lst)
(if (setq lst (getPlotDevices))
(vl-remove
"None"
(vl-remove-if-not
'(lambda (x) (wcmatch x "*.pc3"))
lst
)
)
)
)
; retrieve a list of system plot devices
; file dependencies
; getPlotDevices.lsp
(defun getSystemPlotDevices (/ lst)
(if (setq lst (getPlotDevices))
(vl-remove
"None"
(vl-remove-if
'(lambda (x) (wcmatch x "*.pc3"))
lst
)
)
)
)
--
Autodesk Discussion Group Facilitator
"per" <noname@houseofman.com> wrote in message
news:41d2dfb5$1_1@newsprd01...
| Quote: | Hi there,
I am looking for a way within VisualLISP to extract a list of Page setups
within a drawing and/or a list of available output print devices. If there
is someone with the knowledge to help me out, I would greatly appreciate
it.
Thank you in advance for your help.
--
Phillip
|
|
|
| Back to top |
|
 |
per
Guest
|
Posted:
Fri Dec 31, 2004 7:44 pm Post subject:
Re: Listing of Page setup and/or output devices |
|
|
Very good, thank you for your time. I appreciate your help.
--
Phillip
"pablorico21" <nospam@address.withheld> wrote in message
news:9373826.1104420822713.JavaMail.jive@jiveforum1.autodesk.com...
| Quote: | It's a idea, this routine bellow find the main printter installed in Pc:
(DEFUN PRINTTER_FROM_PC (/ ACFROMC PRINTTERS_IN_THIS_PC
PRINTTERS_IN_THIS_PC PRINTTER_L
PRINTTERS_FINAL)
(SETQ ACFROMC (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))
(SETQ PRINTTERS_IN_THIS_PC
(VLAX-SAFEARRAY->LIST
(VLAX-VARIANT-VALUE
(VLA-GETPLOTDEVICENAMES (VLA-GET-ACTIVELAYOUT ACFROMC)))))
(FOREACH PRINTTER_L PRINTTERS_IN_THIS_PC
(IF (AND (NOT (WCMATCH PRINTTER_L "*.pc3")) (/= PRINTTER_L "None"))
(SETQ PRINTTERS_FINAL (CONS PRINTTER_L PRINTTERS_FINAL))))
(car PRINTTERS_FINAL))
;----------------------------------------- |
|
|
| Back to top |
|
 |
per
Guest
|
Posted:
Fri Dec 31, 2004 7:46 pm Post subject:
Re: Listing of Page setup and/or output devices |
|
|
Excellent,
Thank you very much Jason and have a very happy and prosperous New Year.
--
Phillip
"Jason Piercey" <Jason AT atreng DOT com> wrote in message
news:41d4247c$1_2@newsprd01...
| Quote: | Phillip,
Here are some toolbox functions that I use. The first
one will get the names of the pagesetups defined in the
specified document, the other three are used to get
the plot device information (IIRC, the functions for
plot devices came from Doug Broad)
; function to determine what plotconfigurations
; are defined in the specified document
; [document] - document object
; return: list of strings or nil
; (getPlotConfigNames (vla-get-activedocument (vlax-get-acad-object)))
(defun getPlotConfigNames (document / names)
(reverse
(vlax-for x (vla-get-plotconfigurations document)
(setq names (cons (vla-get-name x) names))
)
)
)
; obtain a list of available printers/plotters
; return: list of strings or nil
(defun getPlotDevices (/ hide layout)
(if (setq hide (= "1" (getenv "HideSystemPrinters")))
(setenv "HideSystemPrinters" "0") )
(setq
layout
(vla-get-activelayout
(vla-get-activedocument
(vlax-get-acad-object))))
(vla-refreshplotdeviceinfo layout)
(if hide (setenv "HideSystemPrinters" "1"))
(vlax-invoke layout 'getplotdevicenames)
)
; retrieve a list of .pc3 devices
; file dependencies
; getPlotDevices.lsp
(defun getPC3Devices (/ lst)
(if (setq lst (getPlotDevices))
(vl-remove
"None"
(vl-remove-if-not
'(lambda (x) (wcmatch x "*.pc3"))
lst
)
)
)
)
; retrieve a list of system plot devices
; file dependencies
; getPlotDevices.lsp
(defun getSystemPlotDevices (/ lst)
(if (setq lst (getPlotDevices))
(vl-remove
"None"
(vl-remove-if
'(lambda (x) (wcmatch x "*.pc3"))
lst
)
)
)
)
--
Autodesk Discussion Group Facilitator
"per" <noname@houseofman.com> wrote in message
news:41d2dfb5$1_1@newsprd01...
Hi there,
I am looking for a way within VisualLISP to extract a list of Page setups
within a drawing and/or a list of available output print devices. If
there
is someone with the knowledge to help me out, I would greatly appreciate
it.
Thank you in advance for your help.
--
Phillip
|
|
|
| Back to top |
|
 |
|
|
|
|