add support path code problem

Discussion in 'AutoCAD' started by devon, Jan 6, 2005.

  1. devon

    devon Guest

    Hi,

    I use this code (from these forums) to add support paths to acad over the lan.

    Mu problem is that it keeps adding in the same paths again each time you start acad. Is there a way to add an "if" statement or something so that if the path exists not to add?


    ;----- Start add support path -----
    (defun addsuppath ( / FilesPref suppath)
    (vl-load-com)
    (setq FilesPref (vla-get-files(vla-get-preferences
    (vlax-get-acad-object)))) ;Get the PreferencesFiles object with
    (setq suppath (vla-get-supportpath FilesPref)) ;Get the current support path
    (setq suppath (strcat suppath ";" "o:\\Acad\\LIB"));Append the new folder and put string together
    (vlax-put-property filespref "SupportPath" suppath) ;Finally put the new support path in the PreferencesFiles object
    ;(prompt "\nAdditional support paths have been added")
    (vlax-release-object FilesPref) ;release FilesPref
    (vlax-object-released-p FilesPref) ;test for release
    (princ)
    ) ;end of code for addsuppath
    (addsuppath)
    ; End add support path -----

    Thanks
    Devon
     
    devon, Jan 6, 2005
    #1
  2. devon

    ECCAD Guest

    ECCAD, Jan 6, 2005
    #2
  3. devon

    devon Guest

    Hi,

    Thanks for the quick reply, but I can't seem to get it working.
    I am a little confused.

    Thanks.
     
    devon, Jan 6, 2005
    #3
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.