lisp initiation from menu.

Kevin Nehls

Usenet Archive
Joined
Jul 3, 2003
Messages
52
Reaction score
0
I've made mine into command line commands:

(defun c:dszoom
(c:ds_zoom coord_set)
(princ)
)

then just use this in the menu:
[Zoom to City]^C^CDSZOOM;

BTW, you may want to think about either renaming the (c:ds_zoom) function so that it doesn't have the C: prefix or making it so you don't have to pass it an argument, then you could just call DS_ZOOM from the menu and be done with it ;)
 
All,

What's the best way to:

1.) make a chunk of lisp, in a menu item, transparent on the command line.

(<function name> <parameters>)

Here is what I have in the MENU:

[Zoom to City]^C^C(C:DS_ZOOM COORD_SET);

2.) To make the command react like a typical autocad command on the commandline in that hitting a return will start the command again.

These seem like a real easy things to do, but I don't think I've ever needed to do this before.

Thanks

bobb
 
I was wondering about a command alias as well.

Kevin said:
I've made mine into command line commands:

(defun c:dszoom
(c:ds_zoom coord_set)
(princ)
)

then just use this in the menu:
[Zoom to City]^C^CDSZOOM;

BTW, you may want to think about either renaming the (c:ds_zoom) function so that it doesn't have the C: prefix or making it so you don't have to pass it an argument, then you could just call DS_ZOOM from the menu and be done with it ;)

I was trying to make a generic routine for many uses. This is the reason for the parameters.

I suppose I can take the route of simply keeping the coord_set value current and use this approach.

Thanks

bobb
 
This is what I ended up with, I think it will give the most flexibility over the long run:

(defun DS_ZOOM (BBOX / )
(setq cur_cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "zoom" "window" (car BBOX) (cadr BBOX))
(setvar "CMDECHO" cur_cmdecho)
(princ)
);DEFUN

(defun C:DS_ZOOM_CITY ( / ) (DS_ZOOM coord_set))

Thanks Kevin.

bobb

P.S. Now to figure out how to throw a comment show a valid completion of operation on the end of the function. :c)
 

Latest threads

Back
Top