No, not necessary.. I'd even say that it is best if the lisp makes the job directly on automatically generated files. If there is no man made manipulation before, the input is constant...
Au contraire! It is easier to discard any overrides that contain "" than trying to manipulate the string to compare it to a real number.
Ok, here it is. At the beginning, there is the variable exclusionlist. I made the lisp to disregard any item in it, so for now it wont modify any dimensions with no overrides ("") and wont modify "" overrides. Any other dimension will get overlined. Since the dimensions that have same override as original value have I didn't bother comparing overwrittenvalue and realvalue. No need to do so.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;LSP routine made by Jef!
;;2014-02-06
;;with no expressed written or applied warranty
;;;;;;;;;;;;;;
(defun c:OverrideFinder ( / working_list counter entity entityslist overwrittenvalue realvalue exclusionlist)
(command "undo" "be")
(setq exclusionlist (list "<>" ""));add more if required
(if (setq working_list (ssget "_X" '((0 . "*DIMENSION")) ))
(progn
(princ "Dimensions detected")
(setq counter 0)
(while (< counter (sslength working_list))
(setq entity (ssname working_list counter))
(setq entityslist (entget entity))
(if (not (member (setq overwrittenvalue (cdr (assoc 1 entityslist))) exclusionlist))
(progn
(princ "\nDimension processed!")
(setq realvalue (cdr (assoc 42 entityslist)))
(entmod (subst (cons 1 (strcat "%%o" overwrittenvalue)) (assoc 1 entityslist) entityslist))
);progn
(princ "\nDimension with no overwride skipped")
);if
(setq counter (+ 1 counter))
);while
);progn
(alert "No dimensions found.. Ungroup first!")
)
(princ "Processing finished")
(command "undo" "end")
)
Pretty nifty, huh?
If you want to learn LISP, analyze everything expression by expression..
With dedication it is possible to achieve many things.
I never took any class and my post-its made 3 or 4 months ago look like "structure of the if function", "setq doesn't need quotation marks, setvar does".. and look at what I just made. Actually, I self impressed myself!
don't hesitate to Google any function to fully understand it. Take many written notes, it helps assimilate knowledge.. And every time you review your notes you can see the progress you made. For instance: "Hey, last month I needed my notes to make a cond statement".
Don't hesitate to ask if further explanations are required. (you should)
Happy coding,
Cheers
Jef!