chavlji Posted February 24, 2009 Posted February 24, 2009 In Autocad CUI editor I've made some custom command. It is a simple macro. Now I would like to assign some ALIAS to my command. So that if I write "MC" into console, it executes this macro. *I dont mean ALIASEDIT, because I think my command can not be called through Console... this is what I would like to find out here. Quote
lpseifert Posted February 24, 2009 Posted February 24, 2009 Make a lisp instead of a macro, use (defun c:mc ()... Lets have a look at the macro Quote
chavlji Posted February 24, 2009 Author Posted February 24, 2009 Tenx. Ive done that (defun c:V1 () (setq cmdecho_old (getvar "cmdecho"))(setvar "cmdecho" 0) (Command "-VPORTS" "si" "UCSFOLLOW" "1") (princ "\n1 VIEWPORT") (princ) (setvar "cmdecho" cmdecho_old)(princ)) Is it possible to define some global function, that I could use in all my list procedures? Like following: (defun SympleMacro ( Macro Msg) (setq cmdecho_old (getvar "cmdecho"))(setvar "cmdecho" 0) (Command Macro) (princ (strcat "\n" Macro) (princ Msg) (princ) (setvar "cmdecho" cmdecho_old)(princ)) And it would then be called from any my lisp program like this (SympleMacro (list "-VPORTS" "si" "UCSFOLLOW" "1") "1 VIEWPORT") 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.