@mickeforsberg wrote:
....
Is there a way to quickly find duplicate entries and highlight them...? For example if 1.100 is used twice in the drawing.
....
How 'bout this [minimally tested]:
(defun C:FDM (/ mss n mt mtc mtclist); = Find Duplicate Mtexts
(if (setq mss (ssget "_X" '((0 . "MTEXT"))))
(progn ; then
(setq dup (ssadd)); initially empty duplicates list;
; not localized, so you can do something with them
(repeat (setq n (sslength mss))
(setq
mt (ssname mss (setq n (1- n)))
mtc (cdr (assoc 1 (entget mt)))
); setq
(if (member mtc mtclist); value is already used
(ssadd mt dup); then -- put object in duplicates set
(setq mtclist (cons mtc mtclist)); else -- put content in list
); if
); repeat
(if (> (sslength dup) 0) (sssetfirst nil dup))
); progn
); if
(princ)
); defun
It leaves the first-encountered instance of any given value alone, and all subsequent instances of the same value selected/gripped/highlighted. If you want all instances of any value that's duplicated to be identified, that could be done, but it's more complicated.
It assumes there is no internal formatting within the Mtext objects, or at least that any such formatting [color override, etc.] is identical between ones that you would consider duplicates, since it looks at the entire string content of each object, including internal formatting codes.
Since it doesn't localize the 'dup' variable [so you can use that selection set in some kind of process apart from just having them be selected], if you want to run it again in the same editing session in the same drawing, you should wipe that out -- (setq dup nil) -- first.
Kent Cooper, AIA