像这样的?
- (defun c:Test (/ ss i lst)
- ;; Tharwat - 12.Jul.2016 ;;
- (if (setq ss (ssget "_C"
- '(496.344 -32.5268 0.0)
- '(514.247 -41.9455 0.0)
- '((0 . "*TEXT"))))
- (progn
- (repeat (setq i (sslength ss))
- (setq lst
- (cons
- (cdr (assoc 1 (entget (ssname ss (setq i (1- i))))))
- lst))
- )
- (if (and lst (< (length lst) 11))
- (alert
- (strcat "Text string(s) :\n"
- (apply 'strcat
- (mapcar '(lambda (o) (strcat o "\n"))
- (reverse lst)))))
- (progn
- (princ "\nText string(s) :\n")
- (mapcar '(lambda (o) (princ (strcat o "\n")))
- (reverse lst))
- (textscr)
- )
- )
- )
- (princ "\nNo text(s) found !")
- )
- (princ)
- )
|