| Author |
Message |
devon
Guest
|
Posted:
Thu Jan 06, 2005 5:35 am Post subject:
add support path code problem |
|
|
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
|
|
| Back to top |
|
 |
ECCAD
Guest
|
Posted:
Thu Jan 06, 2005 5:38 am Post subject:
Re: add support path code problem |
|
|
Try this instead.
Cheers.
Bob
www.bobscadshop.com |
|
| Back to top |
|
 |
devon
Guest
|
Posted:
Thu Jan 06, 2005 5:43 am Post subject:
Re: add support path code problem |
|
|
Hi,
Thanks for the quick reply, but I can't seem to get it working.
I am a little confused.
Thanks.
|
|
| Back to top |
|
 |
ECCAD
Guest
|
Posted:
Thu Jan 06, 2005 5:44 am Post subject:
Re: add support path code problem |
|
|
Is there a particular question ?
Bob |
|
| Back to top |
|
 |
devon
Guest
|
Posted:
Thu Jan 06, 2005 5:45 am Post subject:
Re: add support path code problem |
|
|
Hi,
I get this error... Unknown command "ADDSUPPORTPATH".
Do you know why this would be?
Thanks
Devon |
|
| Back to top |
|
 |
ECCAD
Guest
|
Posted:
Thu Jan 06, 2005 5:52 am Post subject:
Re: add support path code problem |
|
|
My bad, the .zip didn't have the full .lsp file.
This one does.
Bob |
|
| Back to top |
|
 |
devon
Guest
|
Posted:
Thu Jan 06, 2005 6:01 am Post subject:
Re: add support path code problem |
|
|
Now thats a nice bit of code!
Cheers Bob.
Regards,
Devon |
|
| Back to top |
|
 |
ECCAD
Guest
|
Posted:
Thu Jan 06, 2005 6:02 am Post subject:
Re: add support path code problem |
|
|
No prob.
:) |
|
| Back to top |
|
 |
|
|
|
|