(DEFUN C:CTXT ()
(prompt "\nSelect text strings ")
(setq txtent NIL
entlst NIL
)
;;; (SETQ mltss (SSADD))
(WHILE (SETQ thisent (NENTSELP))
(PRINC "\nObject selected: ")
(PRINC (CDR (ASSOC 0 (ENTGET (CAR thisent)))))
(PRINC ": ")
(IF (ASSOC 1 (ENTGET (CAR thisent)))
(PRINC (CDR (ASSOC 1 (ENTGET (CAR thisent)))))
)
(PRINC)
(IF
(AND
(OR
(WCMATCH (CDR (ASSOC 0 (ENTGET (CAR thisent)))) "ATTRIB")
(WCMATCH (CDR (ASSOC 0 (ENTGET (CAR thisent)))) "TEXT")
(WCMATCH (CDR (ASSOC 0 (ENTGET (CAR thisent)))) "MTEXT")
)
(NOT (MEMBER (CAR thisent) entlst))
)
(SETQ entlst (APPEND entlst (LIST (CAR thisent))))
)
)
(IF (AND entlst (> (LENGTH entlst) 0))
(PROGN
(SETQ strcnt (LENGTH entlst)
sscnt 0
txtstrcat NIL
)
(WHILE (< sscnt strcnt)
(SETQ thisentdef (ENTGET (NTH sscnt entlst)))
(SETQ txtstrcat (STRCAT
(IF txtstrcat txtstrcat "")
(IF (ASSOC 1 thisentdef)
(CDR (ASSOC 1 thisentdef))
" "
)
(IF (ASSOC 3 thisentdef)
(CDR (ASSOC 3 thisentdef))
" "
)
(IF (AND (ASSOC 3 thisentdef)
(ASSOC 3 (CDR (MEMBER (ASSOC 3 thisentdef) thisentdef)))
)
(CDR (ASSOC 3 (CDR (MEMBER (ASSOC 3 thisentdef) thisentdef))))
" "
)
" "
)
)
(SETQ sscnt (1+ sscnt))
)
(SETQ txtstrtokened (DOS_STRTOKENS txtstrcat " "))
(SETQ txtstripped (MAPCAR '(LAMBDA (x) (IF (WCMATCH x " *")
(WHILE (WCMATCH x " *") (SETQ x (SUBSTR x 2))))
(IF (WCMATCH x "* ")
(WHILE (WCMATCH x " *") (SETQ x (SUBSTR x 1 (1- (STRLEN x))))))
x
)
txtstrtokened
)
)
(IF (EQ (LAST txtstripped) "")(SETQ txtstripped (REVERSE (CDR (REVERSE txtstripped)))))
(SETQ txtstripped (MAPCAR '(LAMBDA (x) (IF (NOT (EQ x (LAST txtstripped))) (STRCAT x " ") x)) txtstripped))
(SETQ ctxt-str (EVAL (CONS 'STRCAT txtstripped)))
(c:tnote)
)
)
)