; File  MAX.LSP   Replace Blocks  modificato da ingoenius 24/11/2003

(defun c:Lech ( / n js ent pt1 ech)

   (SETQ CMDE (GETVAR "cmdecho"))

   (SETVAR "CMDECHO" 0)

   (setq n 0 )
   (command "_undo" "_m")
   (prompt "\nSelection des objets :")
   (setq js (ssget))
   (initget 1)
   (setq ech (getstring "<Facteur d'echelle>/Reference :"))
   (if (or (= ech "R") (= ech "r"))
      (progn
         (setq long_ref (getreal "Longueur de reference <1>:")) 
         (if (= nil long_ref) (setq long_ref 1.0000000))
         (initget (+ 1 2 4))
         (setq long_new (getreal "Nouvelle Longueur:"))
      )
   )
   (repeat (sslength js)
      (setq ent (ssname js n))
      (SETQ PT1 (cdr (assoc 10 (entget ent))))
      (if (or (= ech "R") (= ech "r"))
         (command "_SCALE" ent "" pt1 "r" long_ref long_new)
         (command "_SCALE" ent "" pt1 ech)
      )
      (setq n (1+ n))
      (IF (= (/ n 5.00) (/ n 5)) (prompt "."))
   );repeat

   (SETVAR "CMDECHO" CMDE)

   (terpri)

)