;;; Change Width Factor for user selected Texts similar to Width Factor of selected "example" text
;;; Created by Igal Averbuh 2017 (based on some existing routines with different approaches)

(defun c:cf (/ ennyi23 wb23 shell23 loui23 el23)
(initget 7)

(setq ent (entget (car (entsel "\nClick on Text with needful Width Factor:"))))
(setq wb23 (cdr (assoc 41 ent)))

(prompt "\nSelect text(s) to change Width Factor.... ")

(setq ennyi23 (ssget '((0 . "*TEXT"))))

(setvar "cmdecho" 0)
(initget 7)

(setq shell23 (sslength ennyi23))

(setq loui23 0)
(while (< loui23 shell23)
(setq el23 (entget (ssname ennyi23 loui23)))
(if (= "TEXT" (cdr (assoc 0 el23)))
(setq el23 (subst (cons 41 wb23) (assoc 41 el23) el23))
(entmod el23)
(setq loui23 (1+ loui23))
(setvar "cmdecho" 1)