(defun c:haws-INCNUM ( / ss off e d s s1 i j fltr dec)
(haws-core-init 44)
  (setvar "dimzin" 0)
  (setq fltr (list(cons 0 "TEXT") (cons 1"*#*")))
  (cond
    ((not (setq ss (ssget fltr))))
    ((not (setq off (getstring "\nIncrement: "))))
    ((zerop (atof off))(princ "\nValue must be non-zero."))
    (t 
      (setvar "cmdecho" 0)
      (command "._undo" "_g")
      (setq off (atof off))
      (repeat (setq i (sslength ss))
        (setq 
          e (ssname ss (setq i (1- i)))
          d (entget e)
          s (cdr (assoc 1 d))
        )
       (cond
         ((/= "" (cadr(setq s(HAWS-EXTRACT s))))
           (setq dec 0 j 0)
           (cond
             ((not (wcmatch (cadr s) "*.*")))
             (t
                (repeat (strlen (cadr s))
                 (setq j (+ 1 j))
                 (if (= (substr (cadr s) j 1) ".")
                   (setq dec 0)
                   (setq dec (+ 1 dec))
                 )
               )
             )
            )
           (entmod
             (subst 
               (cons 1 (strcat (car s) (rtos (+ off (atof (cadr s))) 2 dec) (caddr s)))
               (assoc 1 (entget e))
               (entget e)
              )
            )
          )
        )
      )
      (command ".undo" "e")
    )
  )
  (princ)
)
