goorgoor Posted November 26, 2013 Posted November 26, 2013 Hi, I'm trying to add a new toolbar button. I have this X.lsp at "\\files\cad\AutoCAD\LISP\X.lsp" Found this macro by surfing around (among others): ^C^C^Pcsaa; I want to know how can a code find my lsp, load it and the rund it. Appriciate any help! Quote
MSasu Posted November 26, 2013 Posted November 26, 2013 (edited) Presuming the name of command defined inside X.LSP is XCommand: ^C^C^P(progn (load "[color=red][b]\\[/b][/color]\\files\\cad\\AutoCAD\\LISP\\X.lsp" (alert "Unable to find X.LSP")) ([color=blue]c:XCommand[/color]) (princ)) ^P Please note the doubled backslashes. Edited November 26, 2013 by MSasu Didn't noticed that path is a server one Quote
rkmcswain Posted November 26, 2013 Posted November 26, 2013 If the function you want to run is also named "X", you could do it like this: (if (not c:x)(load "\\\\server\\share\\cad\\AutoCAD\\LISP\\X.lsp"));x; Quote
goorgoor Posted November 26, 2013 Author Posted November 26, 2013 Hi and thanks for your reply. None of the codes above work for me See the attached pictures. Quote
GP_ Posted November 26, 2013 Posted November 26, 2013 If the function is named x write in the button macro: ^C^C(if (not x) (load "//pcname/partition/files/cad/AutoCAD/x")) x Quote
goorgoor Posted November 26, 2013 Author Posted November 26, 2013 Like this: ^C^C(if (not x) (load "\\files\cad\AutoCAD\LISP\x.lsp")) x If the function is named x write in the button macro: ^C^C(if (not x) (load "//pcname/partition/files/cad/AutoCAD/x")) x Quote
GP_ Posted November 26, 2013 Posted November 26, 2013 Like this:.... I seem to be two different things ^C^C(if (not x) (load "\\files\cad\AutoCAD\LISP\x.lsp")) x ^C^C(if (not x) (load "//files/cad/AutoCAD/LISP/x")) x Quote
goorgoor Posted November 26, 2013 Author Posted November 26, 2013 I see ...It does work now. but only on my PC. How can i distribute at my office with my other colleagues? Is there a way to export this toolbar button? I seem to be two different things ^C^C(if (not x) (load "\\files\cad\AutoCAD\LISP\x.lsp")) x ^C^C(if (not x) (load "//files/cad/AutoCAD/LISP/x")) x Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.