Well, I found version 3.0 and gave it a try. What I suggested did not work.
StripMtext now does a lot more, but there are built-in dependencies that do
not allow its inner workings to be used independently as they used to be.
A solution is to use the older version (2.1 is what I found initially). I
renamed the file to StripMtext21.lsp, and renamed the global functions the
same way - that way there would be no conflict if you wanted to use the newer
version (by itself) also. The revised file is attached. And the revised Uline
routine is this:
(load "stripmtext21") ; Be sure it's on search path
(defun c:uline (/ ss1 ss2 num ent elist str)
; TEXT
(setq
ss1 (ssget '((0 . "*TEXT")))
ss2 (ssadd) ; empty sset for mtext only
num 0
)
(repeat (sslength ss1)
(setq
ent (ssname ss1 num) ; the entity
num (1+ num)
elist (entget ent) ; the entity data list
str (cdr (assoc 1 elist))
)
(if (= (cdr (assoc 0 elist)) "TEXT")
(progn
(while (wcmatch (strcase str) "*%%U*")
(setq
str (vl-string-subst "" "%%U" str)
str (vl-string-subst "" "%%u" str)
)
);while
(setq str (subst (cons 1 str)(assoc 1 elist) elist))
(entmod str)
);progn
; MTEXT
(ssadd ent ss2) ; add the mtext to the sset
);if
);repeat
; MTEXT (if any selected)
(if (> (sslength ss2) 0) ; not still empty
(StripMtext21 ss2)
)
(princ)
)
Ken Krupa
Autodesk Authorized Developer
www.krupacadd.com
Tom Smith wrote:
> Ken, you're right, thanks.
>
> I was hoping it could be made to work as you had it, without having to edit STRIPMTEXT, but I guess that will be necessary.
>
> To get around that kind of thing in my own lisps, I usually try to distinguish between the actual "working" routine (which can be called with parameters) and the "command" version (which solicits input from the user, then calls the working routine.) That way I can call the function from another routine if need be. Apparently that's how the STRIPMTEXT that you had was set up.