You are on page 1of 4

Adding Lisp Files to a Tool Palette

Posted on May 30, 2012by AutoCAD Tips


If you have some lisp routines that you would like to have available when you are
working in various drawings here is a way to have them available in all your drawings.
This method of adding the .lsp files to a tool palette makes them available and will load
them only when they are needed. Other methods like using
an acad.lsp or acaddoc.lsp will load all the lisp files upon each drawing that you open
and depending on how many lisp files you have may be a little slow.
First place your  lisp files and button images into a folder that will be a stable
environment where it will not accidentally get moved or erased. Button images can be of
various file types and sizes. In this example I have used 32×32 pixel bitmaps (.bmp).

Right click in the Tool Palette and select “New Palette” to place the new tools on. This
will create a new tab on the tool palette… Give the new palette a unique name.

We now need to populate the new palette with content. The easiest way to do this is to
simply drag something from the drawing area onto the palette and then modify its
properties. Below, I have created a line and then dragged it onto the palette.

To change the tool’s properties from being just another line tool, right click and select
“Properties”

The 5 areas below need to be changed in order for this tool to be the new custom tool:

1. Give the tool a unique and meaningful name


2. Give the new tool a meaningful description so that when you hover over the tool
it will tell you what it does
3. Change the “Use flyout” option to “No”
4. Fill out the command string to specify the path to where the .lsp file resides and
what the command call is in order to start the lisp routine.
5. Give the new tool a cool new image/button
To define an image to use as the button, simply right click in the square area in the
upper left and select “Specify image” and then browse to the image, select it and click ok.

Advertisements
Related
Up and Running with the 2013 Core ConsoleIn "AutoCAD 2013"
Changing A Block Insertion PointIn "Blocks"
Adding OLE Objects and Make Them PrintIn "Customization"

About AutoCAD Tips


This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks
that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one
tip to make your drafting/design experience better.
View all posts by AutoCAD Tips →

This entry was posted in AutoLISP, Customization, Manage, TIPS. Bookmark the permalink.

← Using Your Mouse to Move, Copy or Clear a Selection Set


Intro to Chamfer →
8 Responses to Adding Lisp Files to a Tool Palette

1. Henrik says:
June 26, 2012 at 2:58 AM

Hi
This is an exciting and interesting blog! I really like looking around in here;)
Could you please help me out with a small autolisp code?
I`d like to make a little program for inserting company logo to title blocks.
When using the attach image command, there is so many steps to go through before the
image gets placed.
What I dream of is a small program that lets me click a button that sends me to a
specified directory where I can select my image file, then the program just lets me place
this image in the right place in title block in layout, prompting for nothing but insertion
point.
Reply

o AutoCAD Tips says:
July 2, 2012 at 11:02 AM

Hello,
What you are basically describing is the same process for inserting a block. I don’t think
that there is a way to bind a picture to a drawing but if you can bind one to a drawing,
that would be the easiest way to go and then a simple lisp or macro that defines where
the block is located on your computer or on the network can easily be made.
the first thing to consider is whether the logo can be converted to autocad objects (lines,
arcs, hatches…) At my previous employer, I would convert logos to blocks because they
plot better and look better on PDFs. If you want, you can send me a pic of the logo and i
will see if I can convert it for you. then we can make a lisp that inserts that block
Reply

You might also like