AQucsaiJr Posted October 28, 2009 Posted October 28, 2009 I tried this, but it does not seem to work: (defun c:ExplodeMtext () (command "._explode" (ssget "_X" '((0 . "MTEXT"))) "" ) (princ) ) Anyone have a simple LISP that will explode all mtext in a drawing? Quote
AQucsaiJr Posted October 28, 2009 Author Posted October 28, 2009 I got this to work... But it only explodes one occurrence of mtext... (defun c:EXMT () (command "._explode" (ssget "X" (list (cons 0 "MTEXT"))) ) (princ) ) I want to explode all mtext in one sweep. Quote
Lee Mac Posted October 28, 2009 Posted October 28, 2009 Try something like this, untested: (defun c:Explode_Mtext (/ i ss ent) (if (setq i -1 ss (ssget "_X" '((0 . "MTEXT")))) (while (setq ent (ssname ss (setq i (1+ i)))) (command "_.explode" ent))) (princ)) Quote
AQucsaiJr Posted October 28, 2009 Author Posted October 28, 2009 Hey Lee; That works great... I am getting an Unknown command "Explode_Mtext" error at the end, but it is working. I guess there is one too many () or "" somewhere. Quote
AQucsaiJr Posted October 28, 2009 Author Posted October 28, 2009 So this is what I changed to fix the error at the end: (defun c:EXMT (/ i ss ent) (if (setq i -1 ss (ssget "_X" '((0 . "MTEXT")))) (while (setq ent (ssname ss (setq i (1+ i)))) (command "_.explode" ent ))) (princ) ) I changed the name only because I have a button that calls that name out and I am too lazy to change it... lol... Thanks for the help Lee! Quote
CarlB Posted October 28, 2009 Posted October 28, 2009 The first lisp you posted would have worked, if you first set "QAFLAGS" to 1. Or you can set it in the outine, then set back to original. QAFLAGS affects exploding a set in lisp, among other undocumented effects. Quote
AQucsaiJr Posted October 28, 2009 Author Posted October 28, 2009 The first lisp you posted would have worked, if you first set "QAFLAGS" to 1.Or you can set it in the outine, then set back to original. QAFLAGS affects exploding a set in lisp, among other undocumented effects. I have never used QAFLAGS... Could you show me the LISP the way you are talking about with the QAFLAGS? Quote
CarlB Posted October 28, 2009 Posted October 28, 2009 Sure... (defun c:ExplodeMtext () (setq UsrQA (getvar "QAFLAGS")) (setvar "QAFLAGS" 1) (command "._explode" (ssget "_X" '((0 . "MTEXT"))) "" ) (setvar "QAFLAGS" UsrQA) (princ) ) 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.