;;线长选择
(defun c:SelectByCurveLength (/ len maxd mind nss ss)
  (setq minD (getdist "\n输入线长最小值<0>："))
  (setq maxD (getdist "\n输入线长最大值<∞>："))
  (or minD (setq minD -1))
  (or maxD (setq maxD 1e1000))
  (setq ss (ssget '((0 . "*line,arc,circle,ellipse"))))
  (or ss (fsxm-silenceexit))
  (setq nss (ssadd))
  (foreach cv (fsxm-ss->enlist ss)
    (setq len (fsxm-curve-length cv))
    (if	(and (<= minD len) (>= maxD len))
      (ssadd cv nss)
    )
  )
  (sssetfirst nil nss)
  (princ "共选择了<")
  (princ (sslength nss))
  (princ ">个合适长度的线条！")
  (princ)
)