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 " ")

29 thoughts on “Adding LISP, VB apps, and more to Tool Palettes

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

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

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

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

    • @ 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.

    • @ 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.

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

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

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

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

  9. 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?

  10. 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?

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

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

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

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