本帖最后由 Andyhon 于 2012-8-7 17:44 编辑

- (Defun Cp2txt_Aux (ent pto)
- (command "Scale" ent "" pto fac)
- (command "change" (mapcar '- pto xx) "" (mapcar '- pto dda))
- (command "change" (mapcar '+ pto xx) "" (mapcar '+ pto dda))
- )
- ;;; For test only
- (Defun C:Cp2txt ()
- (setq ss (ssget '((2 . "ltg"))))
- (setq fac (getreal "\n 比率: ")) ; say 0.5
- (setq i 0)
- (setq ee (ssname ss i)
- pts (acet-ent-geomextents ee) ; acet-ent-geomextents / Required ET
- xx (- (caadr pts) (caar pts))
- dd (* xx (- 1 fac) 0.5)
- dda (list dd 0)
- xx (list (* xx 0.5) 0)
- )
- (while (setq ee (ssname ss i))
- (Cp2txt_Aux ee (apply 'mid_pt pts)) ; mid_pt 站内搜
- (setq i (1+ i))
- (and
- (setq ee (ssname ss i))
- (setq pts (acet-ent-geomextents ee))
- ) )
- )
|