- (DEFUN C:TT ()
- (PRINC "\Select Text(s) 选择文字 :")
- (IF (SETQ SS (SSGET '((0 . "TEXT") (1 . "* *")))) (PROGN
- (SETQ I -1)
- (initget "Yes No")
- (setq kd (getkword "\n[删全部空格Yes/删头尾空格No]<No>"))
- (if (null kd) (setq kd "No"))
- (REPEAT (SSLENGTH SS)
- (SETQ ENT (ENTGET (SSNAME SS (SETQ I (1+ I))))
- AA (CDR (ASSOC 1 ENT))
- CC ""
- J 0)
- (setq p1 (car (textbox ent)))
- (if (= "Yes" kd)
- (REPEAT (STRLEN AA)
- (IF (/= (SETQ TMP (SUBSTR AA (SETQ J (1+ J)) 1)) " ")
- (SETQ CC (STRCAT CC TMP))
- )
- )
- (setq CC (vl-string-trim " " AA))
- )
- (SETQ ENT (SUBST (CONS 1 CC) (ASSOC 1 ENT) ENT))
- (ENTMOD ENT)
- (setq p2 (car (textbox ent)))
- (command "move" (cdr (assoc -1 ent)) "" p2 p1)
- )
- ))
- (PRINC)
- )
|