View Full Version : How to you set up new commands for buttons?
maxoffset
3rd Nov 2009, 11:27 pm
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.
lpseifert
3rd Nov 2009, 11:55 pm
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.
BIGAL
4th Nov 2009, 03:07 am
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
)
alanjt
4th Nov 2009, 03:23 am
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.
maxoffset
4th Nov 2009, 10:33 pm
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.
alanjt
4th Nov 2009, 11:16 pm
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.
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.