本帖最后由 Gu_xl 于 2015-8-11 14:50 编辑
- (defun c:tt ()
- (if (and (setq ss (ssget '((0 . "*line,arc"))))
- (setq d (getdist "\n延伸长度:"))
- (progn
- (initget "Both")
- (setq pt (getpoint "\n延伸方向[两端延伸Both]"))
- )
- )
- (progn
- (command "lengthen" "de" d)
- (repeat (setq n (sslength ss))
- (cond ((= "Both" pt)
- (command (list (setq e (ssname ss (setq n (1- n))))
- (trans (vlax-curve-getstartpoint e) 0 1)
- )
- )
- (command (list e (trans (vlax-curve-getendpoint e) 0 1)))
- )
- (t
- (command (list (setq e (ssname ss (setq n (1- n)))) pt))
- )
- )
- )
- (command "")
- )
- )
- (princ)
- )
|