(defun c:fixblock (/ objects counter height changed subcounter attcount object attent attint objinf blockinfo attcount) (command "undo" "begin") (princ "Objects to fix height: ") (setq objects (ssget) counter 0 height 2.5 changed 0 subcounter 0 attcount 0) (if (< 0 (sslength objects)) (progn (while (< counter (sslength objects)) (setq object (ssname objects counter)) (setq objinf (entget object)) (if (= (cdr (assoc 0 objinf)) "INSERT") (progn (ale_getattribs object) (while (< subcounter (length blockinfo)) (setq attent (nth 2 (nth subcounter blockinfo))) (setq attinf (entget attent)) (entmod (subst (cons 40 height) (assoc 40 attinf) attinf)) (setq subcounter (1+ subcounter) attcount (1+ attcount)) ) (setq counter (1+ counter) changed (1+ changed) subcounter 0) ) (setq counter (1+ counter)) ) ) ) (princ "Invalid Selection!") ) (command "undo" "end" "regen") (princ (strcat (itoa changed) " of " (itoa (sslength objects)) " changed.")) (princ (strcat (itoa attcount) " attributes total.")) (princ) )