(defun c:scale_reference ( / base dist1 dist2 p1 p2 scfactor ss)
  (setq ss (ssget))
  (initget 1)
  (setq base (getpoint "\n点取实体基点:"))
  (initget 1)
  (setq p1 (getpoint "\n点取实体长度起始点:"))
  (initget 1)
  (setq dist1 (getdist "\n点取实体长度终止点:" p1))
  (initget 1)
  (setq p2 (getpoint "\n点取参照实体长度起始点:"))
  (initget 1)
  (setq dist2 (getdist "\n点取参照实体长度终止点:" p2))
  (setq scfactor (/ dist2 dist1))
  (command "_scale" ss "" base scfactor)
)
;(c:scale_reference)
