Jump to content

Recommended Posts

Posted

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.

Posted
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;

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;

Posted
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...

Posted
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;

Posted

Thanks for your help. I was able to get my toolbar setup with the use of the link.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...