Jump to content

Recommended Posts

Posted

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.

Posted

Make a lisp instead of a macro, use (defun c:mc ()...

Lets have a look at the macro

Posted

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")

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