Change WIDTH of multiple polylines POLYWID

;;;; FAQ: [23.3] Change WIDTH of multiple polylines

;;; Sets new polywidth for multiple plines

(defun C:POLYWID (/ wid ele)
  (setq wid (std-getdist 5 "" "New Polyline Width" 

(getvar "PLINEWID") nil)) ; flag 5 not negative

;; only PLINES

  (foreach ele (std-sslist (ssget '((0 . "*POLYLINE"))))
    (command "_PEDIT" ele "_W" wid "")))

or:

(defun C:POLYWID (/ wid)
  (setq wid (std-getdist 5 "" "New Polyline Width" 

(getvar "PLINEWID") nil)) ; flag 5 not negative

;; ssmap is faster

  (std-ssmap 
   '(lambda (ele) (command "_PEDIT" ele "_W" wid ""))
    (ssget '((0 . "*POLYLINE")))))