Adding LISP, VB apps, and more to Tool Palettes

image By now Tool Palettes have probably become a staple of your workspace.  We can put all sorts of things on Tool Palettes; lines and blocks being the most common.  While lines and blocks on tool palettes add a degree of sanity for many, wouldn’t it be nice if we could say add a LISP routine, VB app, even execute a script from a Tool Palette?

Well the good news is that we can, although the process isn’t necessarily obvious for many. 

  1. Create a new Line Tool: Simply draw a line in your drawing, and add it to the desired Tool Palette.

    image

  2. Adjust the Properties of your tool: Right-click on the tool, and select "Properties"

    image

  3. Define the Command: From the resulting "Tool Properties" dialog, you will want to give your tool a name and description.  Both of these can be anything you wish, as neither effects the tools function.

    What we’re most interested in is the "Command" grouping.  First you will want to disable the flyout feature by setting "Use Flyout" to "No".  Next you will want to specify the command you wish to execute.

    image

    • LISP: (LOAD "C:/LISP/sample.lsp");lisp command;
      The above code assumes my LSP file is located on my local C-drive in a LISP folder.  Do note the path mentioned in the above code is generally represented as "C:\LISP\sample.lsp".  For things to work on a Tool Palette we must reverse the slash from a "\" to a "/".

    • SCRIPT:  You can execute just about any script you want.  The trick here is the use a semicolon (;) in place of line breaks.  The final result will be a single-line script.

    • VBA: (COMMAND "-VBARUN" VBAPath " ")

Donnie Gladfelter
Donnie Gladfelter

Donnie is author of the book and Autodesk Official Press, AutoCAD and AutoCAD LT: No Experience Required, a columnist for AUGIWorld Magazine, Autodesk University speaker, and former member of the AUGI Board of Directors.

29 Comments

  1. Can you load different tool palettes per drawing or template???
    eg. one drawing being 1:10 and another 1:20 ???

  2. Can you load different tool palettes per drawing or template???
    eg. one drawing being 1:10 and another 1:20 ???

  3. I am tryiong to create a lisp routine that will generate a simple Keynote legends from keynotes on a leader line…can anyone help?

    thanks,

    Johnathan

  4. I am tryiong to create a lisp routine that will generate a simple Keynote legends from keynotes on a leader line…can anyone help?

    thanks,

    Johnathan

  5. How could I create one of these without using a mouse?
    My company has scripted the creation and deployment of blocks and palettes. We’d like to add lisps on these palettes without having a worker touch all 700 computers every time they get reimaged.

  6. How could I create one of these without using a mouse?
    My company has scripted the creation and deployment of blocks and palettes. We’d like to add lisps on these palettes without having a worker touch all 700 computers every time they get reimaged.

  7. good day! hope u help me. how to contour the area by using autocad need for my company, pls help me coz im fresh grad.

    • @ Thon – I’m not sure your how question relates to this post, or even what you’re trying to accomplish. You can certainly draw contours manually using AutoCAD. To get something a little more automated you’ll want Civil 3D which understands triangulation (DTM). Feel free to e-mail me if you’ve got some additional questions.

  8. good day! hope u help me. how to contour the area by using autocad need for my company, pls help me coz im fresh grad.

    • @ Thon – I’m not sure your how question relates to this post, or even what you’re trying to accomplish. You can certainly draw contours manually using AutoCAD. To get something a little more automated you’ll want Civil 3D which understands triangulation (DTM). Feel free to e-mail me if you’ve got some additional questions.

  9. Hi guys i have a question.
    so if anyone can help it would be much appreciate, im trying to create a circular view port using ACAD LT 04 but thers just no way its going to happen as the LT version doesnt have the option to convert object to viewport. so im wondering if ther would be some way of cheating.. lol .. maby using command line code to make a lil script for it.
    and adding it to the toolbars.
    thanx for taking the time to read this.
    Ramin.
    Scotland

  10. Hi guys i have a question.
    so if anyone can help it would be much appreciate, im trying to create a circular view port using ACAD LT 04 but thers just no way its going to happen as the LT version doesnt have the option to convert object to viewport. so im wondering if ther would be some way of cheating.. lol .. maby using command line code to make a lil script for it.
    and adding it to the toolbars.
    thanx for taking the time to read this.
    Ramin.
    Scotland

  11. blogger !
    I have a problem during opening a drowing file in Acad 08 containing some objects which refers to AutoCad Mechenical desktop.
    what should I do.

  12. blogger !
    I have a problem during opening a drowing file in Acad 08 containing some objects which refers to AutoCad Mechenical desktop.
    what should I do.

  13. i want to do lisp programming for developing some tools for my companycan u help in such. tools like i required to develop is that using VB with Autocad BG so that tools can be used as customised once

    thank u
    Ramesh
    Banglore
    prk8652@gmail.com

  14. i want to do lisp programming for developing some tools for my companycan u help in such. tools like i required to develop is that using VB with Autocad BG so that tools can be used as customised once

    thank u
    Ramesh
    Banglore
    prk8652@gmail.com

  15. Emily – The better way to add a standard command to a Tool Palette would be to first open your Tool Palette, and then go into the CUI command. The lower left corner of the CUI command has all of the standard AutoCAD commands. From there you can just drag your command from the CUI dialog, to your Tool Palette. The neat thing is AutoCAD will just use the standard toolbar icon for the Tool Palette icon.

  16. Emily – The better way to add a standard command to a Tool Palette would be to first open your Tool Palette, and then go into the CUI command. The lower left corner of the CUI command has all of the standard AutoCAD commands. From there you can just drag your command from the CUI dialog, to your Tool Palette. The neat thing is AutoCAD will just use the standard toolbar icon for the Tool Palette icon.

  17. I have a strange question… Once I make this new command do what I want it to, lets say it’s just a standard command like, make block… Where can I find the image files to change the little picture? I found the express tools images, but where are the rest of the tool images?

  18. I have a strange question… Once I make this new command do what I want it to, lets say it’s just a standard command like, make block… Where can I find the image files to change the little picture? I found the express tools images, but where are the rest of the tool images?

  19. Great timing; I’ve recently been trying to develop some scripts to help process a series of tasks across several hundred sheets in one particular project while we learn how to implement C3D at the same time. My next step (when I got the time was to explore adding them to the tool palettes. I’m glad to hear that it is (or at least, may be) viable before I waste more time trying to “save time and be expeditious”. With this many sheets I have to come up with procedures that are based upon “standardization” and “automation”. By the way, we are in the process of developing “office standards” along with everything else.
    I think I’m due for a miracle.

  20. Great timing; I’ve recently been trying to develop some scripts to help process a series of tasks across several hundred sheets in one particular project while we learn how to implement C3D at the same time. My next step (when I got the time was to explore adding them to the tool palettes. I’m glad to hear that it is (or at least, may be) viable before I waste more time trying to “save time and be expeditious”. With this many sheets I have to come up with procedures that are based upon “standardization” and “automation”. By the way, we are in the process of developing “office standards” along with everything else.
    I think I’m due for a miracle.

  21. Thanks for the useful information. I was wondering if there is a way to use a custon icon in the tool palettes for a lisp routine. If I try to use a block for the icon it automatically thinks that I want to insert that block but what I actually want is to run a lisp routine. Any suggestions?

    Thanks

  22. Thanks for the useful information. I was wondering if there is a way to use a custon icon in the tool palettes for a lisp routine. If I try to use a block for the icon it automatically thinks that I want to insert that block but what I actually want is to run a lisp routine. Any suggestions?

    Thanks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from The CAD Geek

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from The CAD Geek

Subscribe now to keep reading and get access to the full archive.

Continue reading