- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun vxs (e / i v lst)
- (setq i 0)
- (while
- (setq v (vlax-curve-getpointatparam e (setq i (1+ i))))
- (setq lst (cons v lst))
- )
- (reverse lst))
- ;;;;;;;;;;;;;;;;;;;;;;;;
- (defun zxd (ent / pts len pt )
- (setq pts (vxs ent))
- (setq len (length pts))
- (setq pt (mapcar
- '(lambda(x)
- (/ x len)
- )
- (apply
- 'mapcar
- (cons '+ pts)
- )
- )
- )
- pt
- )
- (defun c:zxscale ( / i lst sc)
- (setq sc (getreal "\n请输入缩放系数1.00:"))
- (setq i 0)
- (setq lst (ssget '( (0 . "*polyline") (8 . "0")) ) )
- (repeat (sslength lst)
- (setq ent (ssname lst i))
- (command "_.scale" ent "" (zxd ent) sc)
- (setq i (+ i 1))
- )
- )
|