PlotOutputPath

I want to set my plot output path to the current drawing path

But this line:

(setvar "PlotOutputPath" (getvar "DwgPrefix"))

gives me NIL

(getvar "DwgPrefix")

gives me the current drawing path fine

but

(getvar "PlotOutputPath")

just gives NIL despite what appears in the Settings dialog box

Comments

  • This is because, while DWGPREFIX is a system variable, PlotOutputPath is a so called 'preference'. You can get (and if applicable set) a system variable's value simply by typing it's name on the command line or via (getvar xxx) /(setvar yyy newvalue).

    : dwgprefix
    DWGPREFIX = "C:\Users\ferdinandj.BRICSYS\Favorites\Documents\" (read only)

    To Get (/or Set)  a preference is a bit more complicated.
    Preferences  live in the registry (user profile)
    the typical location of the 'PlotOutputPath' preference is:
    HKEY_CURRENT_USER\Software\Bricsys\Bricscad\V10\en_US\Profiles\PROFILENAME\Config\Plot

    Following Lisp function returns the value of the PlotOutputPath preference:


    (defun getPlotOutputPath (/ thisProf thisKey)
      (setq thisProf (vla-get-ActiveProfile (vla-get-profiles (vla-get-preferences (vlax-get-Acad-Object)))))
      (setq thisKey (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" thisProf "\\Config\\Plot"))
      (vl-registry-read thisKey "PlotOutputPath")
    )

  • Cool! Thanks.

    So how do I set  "PlotOutputPath"?

    I know, I should start digging into Visual Lisp.

    I'm sure I can figure it out on my own.

    Can anybody recommend a good online resource for all that Vl-, Vla- etc. stuff?

    I'm fairly good with conventional (Autocad R14) Lisp

     

This discussion has been closed.