Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lisp routines and toolbars...

588 views
Skip to first unread message

Tracey Taylor

unread,
Jul 14, 1998, 3:00:00 AM7/14/98
to
before i spend the time trying to figure out how to do this, can a lisp
routine be assigned to a toolbar button? i'm assuming that i would have
to put the routine in the acad.lsp file so it loads at startup. some of
my users like keyboard entry, others want a button.

--
Tracey Taylor
Dynaload Division
www.transdev.com

Jeff Foster

unread,
Jul 14, 1998, 3:00:00 AM7/14/98
to

Tracey,

Yes, you can assign a LISP routine to a button. You won't have to put
the commands in your ACAD.lsp. Follow these steps. They might not be
the best way, but they will work.

1. Right-click on an existing toolbar and the Toolbars box appears.
2. Select the customize button. The Customize Toolbars box appears.
3. Select the category you wish to use then drag the icon into a
clear space in the window.
4. Close the Customize Toolbar window and right click on the button
that now shows on your screen. A Button Properties box will appear.
A. In the Name blank, enter the a name that describes the
command {doesn't have to be the routine name}.
B. In the Help blank, enter the text that you wish to appear in
the status bar at the bottom of the screen.
C. In the Macro box, enter a command like the one following:
^C^C(load "l:/mce/r14/lisp/zoom2txt")(C:zoom2txt)
D. You may at this point also select a button icon if you choose
to use another in place of the one you previously selected. Also, you
can create one on the spot.
5. Select Apply and close the Button Properities window.
6. Close the Customize Toolbar window.
7. Close the Toolbar window.

At this point, the menu will recompile and should be ready for use.
This is not the only one, just one way of doing it. I'm sure many
other better suggestions will come along, but this one should get you
going.

Hope this helps.

On Tue, 14 Jul 1998 07:56:23 -0400, Tracey Taylor
<tayl...@mailer.transdev.com> wrote these significant words:

>before i spend the time trying to figure out how to do this, can a lisp
>routine be assigned to a toolbar button? i'm assuming that i would have
>to put the routine in the acad.lsp file so it loads at startup. some of
>my users like keyboard entry, others want a button.


Jeff Foster
Owner, CADShack
http://www.cadshack.com
CAD Specialist, McKim & Creed
http://www.mckimcreed.com

Eduardo Muñoz

unread,
Jul 14, 1998, 3:00:00 AM7/14/98
to

Tracey Taylor escribió en mensaje <35AB4767...@mailer.transdev.com>...

>before i spend the time trying to figure out how to do this, can a lisp
>routine be assigned to a toolbar button? i'm assuming that i would have
>to put the routine in the acad.lsp file so it loads at startup. some of
>my users like keyboard entry, others want a button.


So you have...


;;;Something.lsp
(defun c:MyCommand ()
...
)


Now assing to the button:

[.......]^C^CMyCommand


Add to your acad.lsp

(autoload "Something" '("MyCommand"))


Thats all (I think)

Eduardo Muñoz

Bill Farmer

unread,
Jul 14, 1998, 3:00:00 AM7/14/98
to
Tracey,
You might want to modify Jeff's macro line to this:
^C^C(if (not your_routine_name) (load "your_routine_name"))
your_routine_name_command

The 2 ^C^C's (CTRL C) cancel any current command; then, if the lisp routine
is NOT loaded; loads it, else it just executes the command "defun
c:your_routine_command ()". Hope this helps.

Bill Farmer

Jeff Foster wrote in message <35ab570...@adesknews.autodesk.com>...

>>before i spend the time trying to figure out how to do this, can a lisp
>>routine be assigned to a toolbar button? i'm assuming that i would have
>>to put the routine in the acad.lsp file so it loads at startup. some of
>>my users like keyboard entry, others want a button.
>
>

Jeff Foster

unread,
Jul 15, 1998, 3:00:00 AM7/15/98
to

Tracey,

Bill's suggestion is a good one. I would definitely incorporate it.
You may wish to add your LISP file directory to your AutoCAD support
path so that you can keep from having to include pathing in your
command definitions. This allows for simple relocation of files later
if required.

On Tue, 14 Jul 1998 22:54:33 -0500, "Bill Farmer"
<bfa...@acmefan.com> wrote these significant words:

>Tracey,
> You might want to modify Jeff's macro line to this:
>^C^C(if (not your_routine_name) (load "your_routine_name"))
>your_routine_name_command
>
>The 2 ^C^C's (CTRL C) cancel any current command; then, if the lisp routine
>is NOT loaded; loads it, else it just executes the command "defun
>c:your_routine_command ()". Hope this helps.
>
>Bill Farmer
>

<snip>

Tracey Taylor

unread,
Jul 15, 1998, 3:00:00 AM7/15/98
to
thanks guys,

i like the idea of loading the lisp when the button is picked instead of loading
it at startup, especially for those routines that don't get used alot. with the
help of this newsgroup i'm becoming the customizing-guru at work <g>. it wasn't
a hard title to obtain, we've never done any customizing before!

Bill Farmer

unread,
Jul 15, 1998, 3:00:00 AM7/15/98
to
You'll be SORRRRYYYYY!!!!<VBG> Just make sure you compensated for it. Don't
get caught in the trap by setting a precedence of "just a little something
extra thrown in".

Have a goodin!
Bill

Tracey Taylor wrote in message <35AC9CD2...@mailer.transdev.com>...

Jeff Foster

unread,
Jul 15, 1998, 3:00:00 AM7/15/98
to

See my response in pn.take5 entitled Re: Getting paid, was Re: lisp
routines and toolbars...

On Wed, 15 Jul 1998 11:09:42 -0400, "Doug K" <******@voicenet.com>
wrote these significant words:

>What? I can get paid for this stuff?

Doug K

unread,
Jul 15, 1998, 3:00:00 AM7/15/98
to
What? I can get paid for this stuff?

--
Doug Kochel
Designer/Draftsman, Bohler Engineering, Inc.
"spammers made me do it"
change the stars to dougck (you know why)
--------------------------------------------------------------------

Bill Farmer wrote in message <6oi9cl$c1...@adesknews2.autodesk.com>...

Cabot Eudaley

unread,
Jul 17, 1998, 3:00:00 AM7/17/98
to
If you define your button with the (load) routine
then you won't be able to just type it at the
command line. Most of our stuff I've converted
to (autoload), so if it is run from a button,
a menu, the tablet, the command line, or a lisp
routine, it will still load. It basically does
the same thing as the statement shown. We've
included most of our 'larger' lisp routines
in an 'Autoload' section of ACAD.LSP.

Cabot

Tracey Taylor wrote:
>
> thanks guys,
>
> i like the idea of loading the lisp when the button is picked instead of loading
> it at startup, especially for those routines that don't get used alot. with the
> help of this newsgroup i'm becoming the customizing-guru at work <g>. it wasn't
> a hard title to obtain, we've never done any customizing before!
>
> Tracey Taylor
> Dynaload Division
> www.transdev.com

--
Mark Eudaley Engineers, Inc.
me...@ionet.net
(remove NOSPAM from reply to)

Bryan Spain

unread,
Jul 20, 1998, 3:00:00 AM7/20/98
to
I missed some of this conversation, so forgive me if I am repeating what
someone else said but if you preface your button or menu command thusly:

"^C^C(if (null C:XXX) (load "C:/alisp/XXX")) XXX
it will load from either source. After the first time, you can type the name
if you wish.

Of course, you'll have to put in the proper drive and directory, and
substiute the routine name for the XXX in the above example.

Bryan


Cabot Eudaley wrote in message <35AFC60C...@ionet.net>...


>If you define your button with the (load) routine
>then you won't be able to just type it at the
>command line

--snip--

Cabot Eudaley

unread,
Jul 20, 1998, 3:00:00 AM7/20/98
to
You can also use (autoload "XXX" '("XXX")) in say,
the ACAD.LSP file. Then wherever you type or input
XXX, if it is not loaded (from XXX.LSP), then it
loads it. The menu line then becomes
^c^cXXX
Without the autoload, and just the menu line,
then it gives an error if you type XXX at the
command line before using the menu or button.

If XXX.LSP also defines C:XX and C:X then
(autoload "XXX" '("XXX" "XX" "X")) would load
XXX.LSP if you typed any of them.

Cabot

0 new messages