Redefine autocad command to a lisp

Redefine autocad command to a lisp

sunlight1
Enthusiast Enthusiast
426 Views
2 Replies
Message 1 of 3

Redefine autocad command to a lisp

sunlight1
Enthusiast
Enthusiast

hi all 

i wonder if there is a way to replace autocad command and run my lisp instead 

the goal is to run my isolate lisp instead autocad isolate command. 

i used acaddoc.lsp for it but something doesnt work 

i keep getting "Unknown command "MYLISP". Press F1 for help."

 

(command ".undefine" "LAYISO")
	(defun C:LAYISO ()
	(command "MYLISP")
	(princ)
	)

 after that i also edit ACAD.PGP file and insert "MYLISP" name to the list in the file, hopping that whould be ok .

but no... 

I need help to solve that , 

P.S my lisp works fine when i type it straight into the command line

0 Likes
Accepted solutions (1)
427 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

Is your lisp encoded? If not, just rename it to LAYISO.

If yes, then use

(defun c:layiso nil (c:mylisp) (princ))

 

But I would not recommend undefining commands.

0 Likes
Message 3 of 3

sunlight1
Enthusiast
Enthusiast

tnx works great ! 

(command ".undefine" "LAYISO")
	(defun c:layiso nil
	(c:mylisp)
	(princ)
	)

my lisp is in lsp file yes. 

but i rather place that code in my acaddoc.lsp than change the lisp to other users in my company, 

because myb they want to stay with the normal LAYISO command. 

anyway, that works for me tnx a lot !! 

 

0 Likes