AQucsaiJr Posted October 28, 2009 Share 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 Link to comment Share on other sites More sharing options...
AQucsaiJr Posted October 28, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
Lee Mac Posted October 28, 2009 Share 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 Link to comment Share on other sites More sharing options...
AQucsaiJr Posted October 28, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
AQucsaiJr Posted October 28, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
CarlB Posted October 28, 2009 Share 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 Link to comment Share on other sites More sharing options...
AQucsaiJr Posted October 28, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
CarlB Posted October 28, 2009 Share 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 Link to comment Share on other sites More sharing options...
AQucsaiJr Posted October 28, 2009 Author Share Posted October 28, 2009 Ok... I see... Thanks CarlB Quote Link to comment Share on other sites More sharing options...
Olaf Posted October 8, 2021 Share Posted October 8, 2021 Thank all of you guys for this solution. Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted April 6, 2023 Share Posted April 6, 2023 A parting THANK YOU to all!! 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.