@k005 wrote:
* the symbol I always use:
Keep in mind that on your sample drawing, there are three (3) characters representing the ø, 1 I already mentioned on my previous post, another is "Æ" -- ascii code 198, and the other as "ø" -- ascii code 248. I suggest you enforce consistency in using only one type of symbol.
This code only targets the symbol that was used in majority on the TEXT entity
(defun c:DSL ( / dS lst string dP dSize p ) ;Diameter Sze List
;; pBe 2021 ;;;
(if (setq dS (ssget '((0 . "TEXT")(1 . "*ø#*"))))
(progn
(repeat (setq i (sslength dS))
(setq string (cdr (assoc 1 (entget (ssname dS
(setq i (1- i)))))))
(setq dP (vl-string-position 248 string))
(setq dSize (substr string (1+ dP)))
(vl-some '(lambda (c)
(if (setq p (vl-string-position c dSize))
(setq dSize (substr dSize 1 p)))) '(32 47))
(if (not (member dSize lst)) (setq lst (cons dSize lst))
)
)
(print
(setq lst (vl-sort lst '(lambda (a b)
(< (atoi (substr a 2))(atoi (substr b 2))))))
)
)
)
(princ)
)
Command: DSL
Select objects:
("ø8" "ø10" "ø12" "ø14")
Replace this line if you prefer the program to read everything on current tab
(setq dS (ssget '((0 . "TEXT")(1 . "*ø#*"))))
to
(setq dS (ssget "X" (list '(0 . "TEXT")'(1 . "*ø#*")(cons 410 (getvar 'Ctab)))))
HTH