Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

LISP 1

Status
Not open for further replies.

kbravo

Agricultural
Apr 29, 2002
30
I want to add a toolbar button to run my Lisp program. Any help on how to do this????

Thanks

Kurt
 
Replies continue below

Recommended for you

Hi Kurt,

Here is what I do. First make sure that you know where your lisp program is located. Next, start Autocad and right-click on any toolbar. In the gray dialog box, click "NEW" and name the new toolbar what you want, then click "OK". (You can also add the new button to an existing toolbar) Your new toolbar will show up in the list with an "X" next to it. There will also be a small empty toolbar somewhere on your screen with the name that you just typed in. That is your new toolbar. Now, click the "CUSTOMIZE" button. Next, in the flyout box that says "Attribute", click on the down arrow and scroll to "CUSTOM". Drag a blank button onto your new toolbar. Now, right click on the new blank button. This opens up yet another dialog box where you can name the LISP program and add the command to activate when you click on the button. In the lower white box you will see "^C^C". These are "Control C's" which will cancel any commands that are currently running when you press the button. directly after the second C (without a space) type the LISP routine's command that will make it run. On the right side of this dialog box there is an area that you can draw a custom button face that will remind you of the command that this button activates. Draw the button face and save it, click on "APPLY" and the button now shows the new face. If you APPLOAD your LISP program and close out all dialog boxes except your new toolbar, then you are ready to go.

Extra hint... If you add the correct LISP code in your ACAD.lsp file (different spelling for different versions) then your new LISP program will be automatically loaded each time that you open a new drawing, making your new toolbar ready to run. If you do not add the code, you can still use the button after you "APPLOAD" the LISP program.

Hope this helps,
Paul
 
Forgot to mention that I am using AutoCad 2002....
 
PLB Thanks for the Help....I got it all figured out but one thing. When I change the Button Pic and draw a new one to use I can't get it to stay. When I exit Autocad and restart it places a different button pic there, but the Button still works to my new lisp command....

Thanks Kurt
 
Hi Kurt,

I think the problem with the new Button faces is that they may be stored in a different directory that is not listed under your "Search Path" settings. Check this first, If they are there, try saving the new button faces over the old face names (with saveas).

Hope this helps,
PLB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor