@Anonymous wrote:
i want to be completely honest with you...my head exploded trying to figure out what you mean lol
if i understand...i should explode my mleader text first then us the mtext explode lisp?
something like this?
(defun c:xml ( / *error* ss vl ov )
(defun *error* ( msg )
(and ov (mapcar 'setvar vl ov))
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **")))
(princ)
)
(setq vl '("CTAB" "CMDECHO" "QAFLAGS") ov (mapcar 'getvar vl))
(mapcar 'setvar (cdr vl) '(0 5))
(foreach x (cons "Model" (layoutlist))
(setvar 'ctab x)
(if (setq ss (ssget "_X" (list '(0 . "MULTILEADER") (cons 410 x))))
(command "_.explode" ss "")
)
)
(mapcar 'setvar vl ov)
(princ)
)
Pretty much spot on 😁 But it looks like you are setting qaflags to 5?
I personally would change it slightly to
(defun c:xml ( / *error* ss vl ov )
(defun *error* ( msg )
(mapcar 'setvar vl ov)
(if (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **")))
(if (not (zerop (getvar "QAFLAGS"))) (alert (strcat "\nQAFLAGS = " (itoa (getvar "QAFLAGS")))))
(princ)
)
(setq vl '("CMDECHO" "QAFLAGS" "CTAB") ov (mapcar 'getvar vl))
(mapcar 'setvar vl '(0 1))
(foreach x (cons "Model" (layoutlist))
(setvar 'ctab x)
(setq ss (ssget "_X" (list '(0 . "MULTILEADER") (cons 410 x))))
(command "_.explode" ss "")
(setq ss nil)
)
(mapcar 'setvar vl ov)
(if (not (zerop (getvar "QAFLAGS"))) (alert (strcat "\nQAFLAGS = " (itoa (getvar "QAFLAGS")))))
(princ)
)
QAFLAGS is an undocumented system variable which can cause various problems as you know, so if you exit via the local *error* or normally let the user know if it is not zero.
If you are trying to explode ALL your MLEADERS and ALL your MTEXT, you could combine the two together.
(defun c:xml ( / *error* vl ov ss ss1 )
(defun *error* ( msg )
(mapcar 'setvar vl ov)
(if (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **")))
(if (not (zerop (getvar "QAFLAGS"))) (alert (strcat "\nQAFLAGS = " (itoa (getvar "QAFLAGS")))))
(princ)
)
(setq vl '("CMDECHO" "QAFLAGS" "CTAB") ov (mapcar 'getvar vl))
(mapcar 'setvar vl '(0 1))
(foreach x (cons "Model" (layoutlist))
(setvar 'ctab x)
(setq ss (ssget "_X" (list '(0 . "MULTILEADER") (cons 410 x))))
(command "_.explode" ss "")
(setq ss1 (ssget "_X" (list '(0 . "MTEXT") (cons 410 x))))
(command "_.explode" ss1 "")
(setq ss nil ss1 nil)
)
(mapcar 'setvar vl ov)
(if (not (zerop (getvar "QAFLAGS"))) (alert (strcat "\nQAFLAGS = " (itoa (getvar "QAFLAGS")))))
(princ)
)
I am not one of the robots you're looking for