Help Lisp Function

HI all , I' m a new user. I always used Auto.... I developped a function who work great with auto... but when I try to do samething in draftsight i'm  block. Here is my command

(command "pedit" pause "join" "all" "remove" (while (eq 1 (logand (getvar "CMDACTIVE") 1)) (command pause)))

 

I know it's CMDACTIVE it's not working but I dont find the right variable for draftsight . Can somebody can help me with this ??

 

Thanks