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.
- Create a new Line Tool: Simply draw a line in your drawing, and add it to the desired Tool Palette.
- Adjust the Properties of your tool: Right-click on the tool, and select "Properties"
- 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.
-
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 " ")
-







Can you load different tool palettes per drawing or template???
eg. one drawing being 1:10 and another 1:20 ???
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
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.
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.