(defun c:easy_ltscale (/ e d el lay lt l nls ss n)
  (if (and (setq ss (ssget)) ;_不要选Continuous,没有意义
	   (setq d (getdist "\n指定周期长度: ")) ;_根据出图的大小确定或输入
      )
    (progn
      (setq nls (getvar "ltscale"))
      (repeat (setq n (sslength ss))
	(setq e	  (ssname ss (setq n (1- n)))
	      el  (entget e)
	      lay (cdr (assoc 8 el))
	)
	(if (not (setq lt (cdr (assoc 6 el)))) ;_ 如果指定了线形
	  (setq lt (cdr (assoc 6 (tblsearch "layer" lay)))) ;_ 线形是随层的
	)
	(setq l (cdr (assoc 40 (tblsearch "ltype" lt)))) ;_
	(vl-catch-all-apply
	  'vlax-put-property
	  (list (vlax-ename->vla-object e) 'LinetypeScale (/ d l nls))
	)
      )
    )
  )
  (princ)
)