rcb007 Posted October 29 Share Posted October 29 I have the following code, I am trying to replace / update a block definition that is already in the current drawing. I get stuck at redefining part within the command line. Anyway around that? (defun c:test (/ ss basept blockname blkDef blkUsed) (setq blockname "test") (if (setq blkDef (tblobjname "block" blockname)) (if (setq blkUsed (ssget "x" (list (cons 0 "INSERT") (cons 2 blockname)))) (progn (princ (strcat "\nBlock " blockname " already exists. Purging and redefining...")) (entdel blkDef) ) ) ) (princ "\nSelect object for the block: ") (if (setq ss (ssget)) (progn (setq basept (getpoint "\nSpecify base point for the block: ")) (command "_.-block" blockname basept ss "") (command "_.-insert" blockname basept "" "" "") ) ) (princ)) Yes or No, please. ; error: Function cancelled Redefine it? [Yes/No] <N>: y Specify insertion base point or [Annotative/mOde]: *Cancel* Thanks a bunch! Quote Link to comment Share on other sites More sharing options...
rlx Posted Tuesday at 11:40 PM Share Posted Tuesday at 11:40 PM start your code with (setvar "expert" 5) should suppress yes / no question , just put original value back at end of your program Quote Link to comment Share on other sites More sharing options...
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.