add support path code problem
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
add support path code problem

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
devon
Guest





Posted: Thu Jan 06, 2005 5:35 am    Post subject: add support path code problem Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

No prob.
:)
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB