I modified the textmask lisp to bring the existing text to the front instead of recreating the text to solve this problem. Did it quickly and sloppily so there is no attempt at elegance just functionality.
Code:
; ----------------- MASK USING WIPEOUT FUNCTION ------------------
; This function draws a wipeout under text TXT using the
; offset value OSET
; ----------------------------------------------------------------
(defun acet-textmask-make-wipeout (ENT OSET / TXT TXTLAY TBX WIPOUT TXTYP TXTSTR)
(setq TXT (entget ENT (list "*")) ; Get the text's edata
TXTLAY (cdr (assoc 8 TXT)) ; Get the layer of the text
TXTYP (cdr (assoc 0 TXT)) ; Text or Mtext
TXTSTR (cdr (assoc 1 TXT))
)
(if (/= TXTSTR "")
(progn
(if (= TXTYP "TEXT")
(acet-ucs-cmd (list "_object" ENT)) ; set UCS to object
(acet-ucs-to-object ENT)
)
(setq TBX (acet-geom-textbox TXT OSET)) ; Get the points around the text
(if TBX
(progn
(command "_.pline") ; Create bounding pline box
(while TBX
(command (car TBX))
(setq TBX (cdr TBX))
)
(command "_c")
(command "_.wipeout" "_Polyline" (entlast) "_yes") ; create wipeout entity
(setq WIPOUT (entlast))
(command "_.change" WIPOUT "" "_Prop" "_Layer" TXTLAY "_cOLOR" "255" "") ; and set its layer
(acet-ucs-cmd (list "_previous")) ; reset the ucs
; (entmake TXT) ; recreate text
(setq TXT ENT) ; such that it's on top
(command "_.draworder" TXT "" "Front")
(acet-xdata-set (list WIPOUT "ACET-TEXTMASK"
(list
(list "TextObject" (cdr (assoc 5 (entget TXT))) 1005)
(list "Offset" OSET 1040)
)
)
)
(acet-xdata-set (list TXT "ACET-TEXTMASK"
(list
(list "MaskObject" (cdr (assoc 5 (entget WIPOUT))) 1005)
(list "MaskType" "WIPEOUT" 1000)
(list "Offset" OSET 1040)
)
)
)
(command "_.move" TXT "" "0,0" "0,0")
(acet-group-make-anon (list WIPOUT TXT) "In use by TEXTMASK") ; make the text and wipeout a group
; (entdel ENT) ; delete original text
)
); if TBX
); progn then
); if not ""
)