;实体等比例放入框内[mini_ss_2_rec].lsp,已集成到全能缩放命令mini_exscale
(defun C:mini_ss_2_rec ( / old_cmd ss p1 p2 p3 p4 p5 p6 x1 y1 x2 y2 mark)
  (mini_start nil)
  (setq ss (mai_select_first nil "选择等比缩放实体:<退出>" "选择的不是实体."))
  (or (setq p1 (getpoint "\n等比缩放,充满到矩形第一角点:<退出>"))
      (exit)
  )
  (or (setq p2 (getcorner p1 "\n等比缩放,充满到矩形第二角点:<退出>"))
      (exit)
  )
  ;(setq mark (entlast)) ;保留原实体,不保留删除这行
  ;(mai_copy ss nil nil) ;保留原实体,不保留删除这行
  ;(setq ss (mai_newset mark))  ;保留原实体,不保留删除这行
  ;(if (and (= 1 (sslength ss))
  ;         (= "INSERT" (mai_dxf 0 (ssname ss 0)))
  ;    )
   ;   (progn 
   ;     (setq ss (ssname ss 0))
   ;     (mapcar 'set '(p3 p4 p4) (mai_get_blkbox ss nil nil))
   ;   )
      (mapcar 'set '(p3 p4 p4) (mai_ss_rectangle ss))
  ;)
  (mapcar 'set '(x1 y1) (mapcar '- p4 p3))
  (mapcar 'set '(x2 y2) (mapcar 'abs (mapcar '- p2 p1)))
  (setq p5 (mai_divide_point p1 p2 0.5)
        p6 (mai_divide_point p3 p4 0.5)
  )
  (command "_.move" ss "" "non" p6 "non" p5)
  (setq p6 (list (if (and (not (mai_equal x1 0))
                          (not (mai_equal x2 0))
                     )
                     (abs (/ x2 x1))
                 )
                 (if (and (not (mai_equal y1 0))
                          (not (mai_equal y2 0))
                     )
                     (abs (/ y2 y1))
                 )
           )
        p6 (vl-remove nil p6)
        p6 (if p6 (apply 'min p6))
  )
  (if p6 (command "_.scale" ss "" "non" p5 p6))
  (mai_end)
)
