Making a shortcut key to run a lisp program

Making a shortcut key to run a lisp program

gwomackSZT2N
Participant Participant
3,527 Views
5 Replies
Message 1 of 6

Making a shortcut key to run a lisp program

gwomackSZT2N
Participant
Participant

I am trying to create a shortcut on my mouse to bring up this app. 
What is the best way to do this because autocad does not recognize this as an option in the shortcuts menu.
Also is there a way to bypass the set up screen on the app whenever I use the shortcut? 

0 Likes
3,528 Views
5 Replies
Replies (5)
Message 2 of 6

Shneuph
Collaborator
Collaborator

Sounds like you need to make a command first then assign it to the shortcut key... something like this:

Shneuph_0-1594408602079.png

 

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
0 Likes
Message 3 of 6

rkmcswain
Mentor
Mentor

When you say shortcut, do you mean a type in shortcut, like "NU" then enter?

 

You can do that with another tiny lisp function (which you can autoload inside of "acaddoc.lsp")

 

 

(defun c:NU () (c:NumInc)) 

 

As far as skipping the opening dialog of that routine, you'll have to edit the lisp file itself to provide defaults since you want to bypass doing this via the dialog.

R.K. McSwain     | CADpanacea | on twitter
Message 4 of 6

Sea-Haven
Mentor
Mentor

Like this maybe

(defun c:nu()
(if (not NumInc)(load "NumIncV3-9.lsp"))
(c:numinc)
)

 

0 Likes
Message 5 of 6

john.uhden
Mentor
Mentor

Maybe this is more like it...

(defun c:nu ()

  (if (/= (type c:numinc) 'SUBR)(load "numincv3-9.lsp"))

  (c:numinc)

)

Of course that presumes that c:numinc was created using defun, not defun-q.

And of course you don't have to restrict the load to .LSP files.  You can also load .FAS and .VLX files.

John F. Uhden

0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Checking using 'type a good idea just use filename gets around lsp fas vlx, 1st found loads. I normally only have name never had a problem have  a mixture I run fas of commercial so can see if any problems that end users may come across.

0 Likes