AutoLISP: Find Dodgy Dimensions

Keeping this whole “Dodgy Dimensions” theme going…. Here’s another routine that you can use to find dimensions that have had their value altered.

It will simply turn the “dodgy” dimension text green, thus distinguishing it from the correct dimensions.

If your dimensions happen to be green already, alter the color in the code to distinguish the “dodgy” dims in your drawings.

Here’s how:

  • FINDDODGYDIMS <enter> to start

That’s it, The routine will do the rest.

To alter the color back to normal (after correcting the wrong dimension value of course…). The color value is found in the properties palette where the dimension was altered in the first place.

(defun c:FindDodgyDims ( / ss ) (vl-load-com)

(if (setq ss (ssget "_X" '((0 . "*DIMENSION") (1 . "*?*"))))

(

(lambda ( i / e )

(while (setq e (ssname ss (setq i (1+ i))))

(vla-put-TextColor (vlax-ename->vla-object e) acgreen)

)

)

-1

)

)

(princ)

)

About AutoCAD Tips

This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one tip to make your drafting/design experience better.
This entry was posted in AutoLISP, Dimensions, Modifying. Bookmark the permalink.

Leave a comment