maxoffset Posted November 3, 2009 Posted November 3, 2009 ive made some custom buttons and was wondering how to set up a new keyboard command. so typing a command to start the command instead of clicking on it. Thanks in advance. Quote
lpseifert Posted November 3, 2009 Posted November 3, 2009 You can just type the command at the command line... If you want a command alias (shortcut for a command) you can edit your acad.pgp file, easily done by typing Aliasedit at the command line. Quote
BIGAL Posted November 4, 2009 Posted November 4, 2009 You can define any command as a different keyboard command we use stuff like "39" sets the osnap "dv" driveway "XFP" cross fall as a percent You just do little lisps save in autoload etc (defun C:39 () (setvar "osmode" 39) ) I like zzz aaa qqq its easy to get at and unlikely to be used by Autocad. just make them so they run a lisp program etc (defun C:aaa () (load "myprog1") (myprog1) :if it has a defun definition already else leave out ) Quote
alanjt Posted November 4, 2009 Posted November 4, 2009 ive made some custom buttons and was wondering how to set up a new keyboard command. so typing a command to start the command instead of clicking on it. Thanks in advance. If you mean macros, you will need to convert them to lisp. Quote
maxoffset Posted November 4, 2009 Author Posted November 4, 2009 thx for the responses. i was really hoping i could somehow set a new command without this lisp file. currently i have no idea how to create these files. I was hoping since it was easy enough to create a macro (new command button) to click on that i could also accompany it with a type command. I noticed i can set hotkeys (ctrl+k for example) but i couldnt make new command lines. If thats the only way to do it ill try to look into lisp files. Quote
alanjt Posted November 4, 2009 Posted November 4, 2009 thx for the responses. i was really hoping i could somehow set a new command without this lisp file. currently i have no idea how to create these files. I was hoping since it was easy enough to create a macro (new command button) to click on that i could also accompany it with a type command. I noticed i can set hotkeys (ctrl+k for example) but i couldnt make new command lines. If thats the only way to do it ill try to look into lisp files. Maybe something like this: (defun MacroIt (#Macro) (vl-load-com) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (vla-sendcommand *AcadDoc* (vl-princ-to-string #Macro)) ) ;_ defun (defun c:Test1 (/) (MacroIt "-layer set 0\n\n\n") (princ)) (defun c:Test2 (/) (MacroIt "-layer make TEMP\n\n\nline ") (princ)) You would just have to modify your macros a little. Quote
Recommended Posts
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.