Options / Preferences script

Discussion in 'AutoCAD' started by Jeff Clark, Jan 27, 2005.

  1. Jeff Clark

    Jeff Clark Guest

    I would like to create a Script, or even a Lisp routine, that sets
    Preferences.
    Especially, Support File Search Path and Printer Support File Path.
    This would let me get the entire office on the same playing field quickly
    and easily.
    I've written many script files and lisp routines but I can't find how the
    access these setting via the command line where a script or lisp routine has
    to opperate..

    Is it possible??

    Thanks,
    Jeff
     
    Jeff Clark, Jan 27, 2005
    #1
  2. Jeff Clark

    mataeux Guest

    (defun files () (vla-get-Files (vla-get-Preferences
    (vlax-get-acad-object))))
    (vla-put-SupportPath (files) "<search path>")
    (vla-put-PrinterConfigPath (files) "<support folder>\\plotters"))
    (vla-put-PrinterDescPath (files) "<support folder>\\plot styles"))
    (vla-put-PrinterStylesheetPath (files) "<support folder>\\plot styles"))

    i've had trouble using (vla-put-Printer...Path ... so i use setenv, thus:

    (setenv "PrinterConfigDir" "<support folder>\\plotters" ))
    (setenv "PrinterDescDir" "<support folder>\\plotters" ))
    (setenv "PrinterStyleSheetDir""<support folder>\\plot styles"))
     
    mataeux, Jan 28, 2005
    #2
  3. Jeff Clark

    Jeff Clark Guest

    This is great Mat, thanks.
    How does this look:

    (defun files ()
    (vla-get-Files (vla-get-Preferences (vlax-get-acad-object))))

    (vla-put-SupportPath (files) "S:\\CES_STDS\\SPECIAL FONTS")
    (vla-put-SupportPath (files) "S:\\CES_STDS\\SPECIAL-LTYP'S")
    (vla-put-SupportPath (files) "S:\\CES_STDS\\LISP")

    (setenv "PrinterConfigDir" "S:\\CES_STDS\\PLOTTING"))
    (setenv "PrinterDescDir" "S:\\CES_STDS\\PLOTTING"))
    (setenv "PrinterStyleSheetDir""S:\\CES_STDS\\CTB_FILES"))


    I'm a little confused, maybe cause I'm old school Lisp, and don't know squat
    about VLisp.....
    After (vlax-get-acad-object)))), the 4th piren closes the defun. How does
    the rest of the routine function?

    Do you know of a way to display ALL of the environment variables, maybe even
    print them out?

    thanks again,
    Jeff
     
    Jeff Clark, Jan 28, 2005
    #3
  4. Jeff Clark

    mataeux Guest

    unless i'm mistaken, the argument you pass to 'vla-put-SupportPath should
    contain all paths
    so call the function once:

    (vla-put-SupportPath (files) "S:\\CES_STDS\\SPECIAL
    FONTS;S:\\CES_STDS\\SPECIAL-LTYP'S;S:\\CES_STDS\\LISP")

    note the ";" separating the paths
     
    mataeux, Jan 28, 2005
    #4
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.