Jump to content

How to you set up new commands for buttons?


Recommended Posts

Posted

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.

Posted

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.

Posted

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

)

Posted
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.

Posted

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.

Posted
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.

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...