bigtymer Posted March 3, 2010 Posted March 3, 2010 Sorry if this has been covered a thousand times but I am trying to add a toolbar with buttons that will lunch lsp routines. I am working with Autodesk Map5. I am having a hard time figuring it out. The info I have found doesn’t seem to match my version of cad. Any help would be appreciated. Quote
lpseifert Posted March 3, 2010 Posted March 3, 2010 It's kinda old but maybe this will help http://www.cadalyst.com/cad/autocad/creating-your-own-toolbars-for-technically-challenged-4741 Here is a macro to load and invoke a lisp from a toolbar button ^c^c (if not c:LISPCOMMAND)(load "LISPFILENAME"));LISPCOMMAND; Quote
alanjt Posted March 3, 2010 Posted March 3, 2010 It's kinda old but maybe this will helphttp://www.cadalyst.com/cad/autocad/creating-your-own-toolbars-for-technically-challenged-4741 Here is a macro to load and invoke a lisp from a toolbar button ^c^c (if not c:LISPCOMMAND)(load "LISPFILENAME"));LISPCOMMAND; When using load, always fill the second variable to avoid errors if the file cannot be found/loaded. (or c:LISPCOMMAND)(load "LISPFILENAME" nil));LISPCOMMAND; Quote
lpseifert Posted March 3, 2010 Posted March 3, 2010 When using load, always fill the second variable to avoid errors if the file cannot be found/loaded. But if the file cannot be found/loaded wouldn't you want to know? It's only a one line macro for a toolbar button... Quote
alanjt Posted March 3, 2010 Posted March 3, 2010 But if the file cannot be found/loaded wouldn't you want to know? It's only a one line macro for a toolbar button... It's to avoid an error. Be it nil or a string, you always want to fill the second variable. For instance: Command: (load "blah.lsp") Error: LOAD failed: "blah.lsp" Command: (load "blah.lsp" nil) nil Command: (load "blah.lsp" "can't find the file!") "can't find the file!" I should have posted this.. (or c:LISPCOMMAND)(load "LISPFILENAME" "LISPFILENAME cannot be loaded!"));LISPCOMMAND; Quote
bigtymer Posted March 4, 2010 Author Posted March 4, 2010 Thanks for your help. I was able to get my toolbar setup with the use of the link. 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.