- ;; dlen = 双向伸缩曲线长度v1.1---lxx2005.3.25!.
- (defun c:tt ( / d ss i e lst1 lst2 l1 l2 %k)
- ;(setq lst1 nil lst2 nil)
- (vl-cmdf ".undo" "be")
- (initget 128)
- (setq d (getdist "\n 输入双向伸缩长度(加%为百分比,支持正负数):")
- i -1)
- (if (and (= 'STR (type d))(wcmatch d "*%")(> 50 (setq dd (distof(substr d 1 (1-(strlen d)))))))
- (setq %k T)
- )
- (setq ss (ssget '((0 . "LINE,ARC,ELLIPSE,*POLYLINE,SPLINE"))))
- (while (setq e (ssname ss (setq i (1+ i))))
- (setq lst1 (list e (vlax-curve-getstartpoint e))
- lst2 (list e (vlax-curve-getendpoint e)))
- (if %k
- (setq l1 (vlax-curve-getdistatparam e (vlax-curve-getstartparam e))
- l2 (vlax-curve-getdistatparam e (vlax-curve-getendparam e))
- d (* (/ dd 100) (abs(- l2 l1))))
- )
- (vl-cmdf ".LENGTHEN" "de" d lst1 lst2 "")
- )
- (vl-cmdf ".undo" "e")
- (princ)
- )
|