Jump to content

Keyboard Shortcut for LISP command


resullins

Recommended Posts

I have a LISP command, ARRAYINCREMENT.lsp, with an alias of IA. However, I need to assign a keyboard shortcut to it (i.e. CTRL+G) so that I can put it on a certain button of my mouse. However, it doesn't appear in my list of all commands in my CUI, so I'm not sure how to get to it to assign it.

 

Any ideas? I'm really trying to get faster, and the little buttons on my mouse are SO handy for that!

Link to comment
Share on other sites

I know that newer versions have pretty much locked out use of Ctrl key - One work around for this is to use CUI Editor, Transfer Tab, and drag an existing Shortcut Key (Keyboard Shortcuts, Shortcut Keys node) into a separate CUI(x) file. Set that CUI(x) as Main, and edit as needed. When done, restore original Main CUI(x) and use Transfer Tab to drag to Main CUI(x).

 

Note that you may be overwriting an existing shortcut, depending on your naming convention, command, etc., and that the 'Element ID' (from the original shortcut) will remain.

 

I only have one legacy shortcut key, given that my mouse, keyboard accept (multiple key) Macros, so I just use that instead. There may be a better way to accomplish what I described above.

 

HTH

Link to comment
Share on other sites

Hmmm.... @Tiger: I don't know how to create a custom command in the CUI.

 

@Render: I have unassigned the shortcut keys I don't use. Like CTRL+L... since I never use Ortho, and reassigned them to the commands I want to put on my mouse. Copy, Matchprop, etc.

 

Now, I'm not sure what you're trying to tell me about the custom CUI. I already use a custom CUI...

Link to comment
Share on other sites

Hmmm.... @Tiger: I don't know how to create a custom command in the CUI.

 

Simple - from CUI Editor, bottom left pane, make sure 'Command List' is expanded, then select the 'Create new command' button (the star with asterisk in upper right).

 

@Render: I have unassigned the shortcut keys I don't use. Like CTRL+L... since I never use Ortho, and reassigned them to the commands I want to put on my mouse. Copy, Matchprop, etc.

 

Now, I'm not sure what you're trying to tell me about the custom CUI. I already use a custom CUI...

 

Unassign =/= Assign ... This just disables the existing shortcut, and does not enable your customized version.

 

If a Temporary Override is insufficient, then you have to bring a Shortcut Key into your Main CUI(x) by way of the Transfer Tab, from which you can customize as needed.

Link to comment
Share on other sites

Consider the original post:

 

I have a LISP command, ARRAYINCREMENT.lsp, with an alias of IA. However, I need to assign a keyboard shortcut to it (i.e. CTRL+G) so that I can put it on a certain button of my mouse. However, it doesn't appear in my list of all commands in my CUI, so I'm not sure how to get to it to assign it.

 

Any ideas? I'm really trying to get faster, and the little buttons on my mouse are SO handy for that!

 

What I do is:

Add lisp to Startup suite

Type IA ( in my Autocad "IA" is not used for anythig) and that it.

Try it.

Link to comment
Share on other sites

Simple - from CUI Editor, bottom left pane, make sure 'Command List' is expanded, then select the 'Create new command' button (the star with asterisk in upper right).

 

Got it! Thanks!

Link to comment
Share on other sites

I've never run into a situation where I actually had to make a command before... I just used it as-is from the Lisp.

Link to comment
Share on other sites

Got it! Thanks!

 

Happy to help. :beer:

 

I've never run into a situation where I actually had to make a command before... I just used it as-is from the Lisp.

 

Then... the trick is to demand load your routine, so that it (the code) is only loaded into memory the first time the command is invoked. Otherwise, you end up slowing down drawing open to load a bunch of code that you might not need. Not such a big deal when you're not loading that much, but still.

 

Example macro:

 

^C^C^P(if (not [color=red]FunctionName[/color])(load "[color=blue]FunctionFile[/color].lsp"));[color=red]FunctionName[/color];^P

 

 

You can also simply use the Autoload Function if having the button macro is not necessary, and will accomplish the same demand loading. Just have an idea of how you want things to load, and run, and implement the method that suites you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...