Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Plot to file check box

2 REPLIES 2
Reply
Message 1 of 3
JohnFN
285 Views, 2 Replies

Plot to file check box

Hi,
I am trying to write a lisp to simplify my plotting. Is there a way to see if the current (active) pagesetup has the "plot to file" check box checked or not. It would help a lot.
2 REPLIES 2
Message 2 of 3
bnarum1
in reply to: JohnFN

I could be wrong but I believe that the plot to file option is set by device (pc3)
you can find current pc3 device by using
vla-get-configname for each layout.
Message 3 of 3
Anonymous
in reply to: JohnFN

Hi,

I think that this is not a property, but rather a method. "Plot to file"
option can be activated once, when the plot dialog is opened, and after
clicking OK, the option is deactivated, so this does not keep as a
permanent configuration. Next time you have to specify again that you want
to plot to a file by selecting it and this makes me to believe that this is
a method, so in your LISP code you are going to configure it the way you
want it.

The methods you have to use are vla-plottofile when you want to plot to a
file and vla-plottodevice when (obviously) you want to plot to your plotting
device. The following code demonstrates how to use it.

;============================================
(defun c:PLOTTO ()
(initget "File Device")
(if
(not
(setq plot_target
(getkword "\nPrint to[File/]: ")
)
)
(setq plot_target "Device")
)
(plot_to plot_target)
)
;============================================
(defun plot_to (
plot_target
/
AcadApplication
ActiveDocument
PlotObject
)

(setq AcadApplication (vlax-get-acad-object))
(setq ActiveDocument
(vla-get-activedocument AcadApplication)
)
(setq PlotObject (vla-get-plot ActiveDocument))

(defun plot_to_file ( / plot_name configuration_name)
(setq plot_name
(strcat
(vl-filename-base
(vla-get-fullname ActiveDocument)
)
".dwf"
)
)
(setq configuration_name "DWF6 ePlot.pc3")

(vla-PlotToFile
PlotObject
plot_name
configuration_name ;;;if nil, the current config is used
)
)

(defun plot_to_device ( / configuration_name)
(setq configuration_name "Default Windows System Printer")
(vla-PlotToDevice
PlotObject
configuration_name ;;;if nil, the current config is used
)
)
(if (= (strcase plot_target "File"))
(plot_to_file)
(plot_to_device)
)
;no muffler here, it returns true or false
)
;==============================================

Hope it helps,

Constantin




a écrit dans le message de news: 5374540@discussion.autodesk.com...
Hi,
I am trying to write a lisp to simplify my plotting. Is there a way to see
if the current (active) pagesetup has the "plot to file" check box checked
or not. It would help a lot.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost