1
3
2
初来乍到
(defun c:tsel (/ ss lst tss olst ofile)(vl-load-com)(if (setq ss (ssget '((0 . "*TEXT"))))(progn(setq lst(mapcar(function(lambda (x)(vla-get-TextString(vlax-ename->vla-object x))))(vl-remove-if 'listp(mapcar 'cadr (ssnamex ss)))))(foreach str (unique lst)(if (setq tss(ssget "_X"(list '(0 . "*TEXT") (cons 1 str))))(setq olst(cons(cons str (sslength tss)) olst))(setq olst(cons(cons str 0.) olst))))(setq ofile(open(strcat(getvar "DWGPREFIX")(substr(getvar "DWGNAME") 1(- (strlen(getvar "DWGNAME")) 4)) "-StrCnt.txt") "a"))(mapcar(function(lambda (x)(write-line(strcat (car x) "\t"(vl-princ-to-string (cdr x))) ofile))) olst)(close ofile)(princ "\n<< Strings Written to File >>"))(princ "\n<< Nothing Selected >>"))