Variable for Plot to File location

Discussion in 'AutoCAD' started by Andreas, Aug 12, 2004.

  1. Andreas

    Andreas Guest

    Regarding the new R2005 option in Options > Plot and Publish > Plot to File
    folder location

    Is there a variable I can read into my LISP routine to work out where the
    plot files should be going?
     
    Andreas, Aug 12, 2004
    #1
  2. Andreas

    Jürg Menzi Guest

    Hi Andreas

    Try this:
    Code:
    (defun GetPlotToFilePath ()
    (vl-load-com)
    (vla-get-DefaultPlotToFilePath
    (vla-get-Output
    (vla-get-Preferences
    (vlax-get-acad-object)
    )
    )
    )
    )
    Cheers
     
    Jürg Menzi, Aug 12, 2004
    #2
  3. Andreas

    Andreas Guest

    Juerg

    Thank you. It works well.

    However I am not too familiar with Vlisp. Do you mind commenting it out for
    me ecpaining what each line does?

    How did you know what these names are called in the first place to call them
    up. EG: vla-get-DefaultPlotToFilePath

    Where can I get a list of these?

    Do we need the vla-get-output?

    Regards

    Andreas

    PS I modified it slightly. It seems to work ok but not sure I need to do
    this. I didn't know how else to set the path top a variable to use later on
    in my program.

    (defun C:GetPlotToFilePath ()
    (vl-load-com)
    (setq PlotPath (vla-get-DefaultPlotToFilePath
    (vla-get-Output(vla-get-Preferences(vlax-get-acad-object)))))
    )
     
    Andreas, Aug 13, 2004
    #3
  4. Andreas

    Jürg Menzi Guest

    Hi Andreas

    Welcome...¦-)
    Code:
    (defun GetPlotToFilePath ()
    (vl-load-com)			;Initialize ActiveX support
    (vla-get-DefaultPlotToFilePath	;Gets DefaultPlotToFilePath property from...
    (vla-get-Output		;PreferencesOutput object from...
    (vla-get-Preferences		;Preferences object from...
    (vlax-get-acad-object)	;AutoCAD application object
    )
    )
    )
    )
    There is no need to change the function code. 'GetPlotToFilePath' returns the
    value from 'PlotToFilePath' property. Therefore you can set your variable like
    this:
    (setq PlotPath (GetPlotToFilePath))
    See AutoCAD Developer Help -> Visual LISP Developer's Guide -> Working with
    ActiveX
    and...
    AutoCAD Developer Help -> ActiveX and VBA Reference
    The Output object includes among other things the requested property:
    $ (vlax-dump-Object (vla-get-Output *PreferencesObject*)))
    ; IAcadPreferencesOutput2: This object contains the options from the Output
    ; tab on the Options dialog
    ; Property values:
    ; Application (RO) = #<VLA-OBJECT IAcadApplication 00b9b5e4>
    ; AutomaticPlotLog = -1
    ; ContinuousPlotLog = -1
    ; DefaultOutputDevice = "\\\\Server01\\HP Color LaserJet 5500"
    ; DefaultPlotStyleForLayer = "Normal"
    ; DefaultPlotStyleForObjects = "ByLayer"
    ; DefaultPlotStyleTable = ""
    ; DefaultPlotToFilePath = "C:\\PrintSpool"
    ; OLEQuality = 3
    ; PlotLegacy = 0
    ; PlotPolicy = 1
    ; PrinterPaperSizeAlert = 0
    ; PrinterSpoolAlert = 0
    ; UseLastPlotSettings = 0

    Cheers
     
    Jürg Menzi, Aug 13, 2004
    #4
  5. Andreas

    Andreas Guest

    Thanks Jürg. It helps a lot more.
    I have now incorporated your initial code in my lisp file and works well.

    Much appreciated.

    Andreas

     
    Andreas, Aug 14, 2004
    #5
  6. Andreas

    Jürg Menzi Guest

    Glad to help you...¦-)

    If you like to find more of this vl-, vla-, vlax-stuff, visit my
    homepage -> Free Stuff

    Cheers
     
    Jürg Menzi, Aug 14, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.