- (defun c:y2 (/ D F E N P0 P1 SS)
- (setq d (getdist "\n延伸长度:"))
- (setq F (getvar "DIMLFAC"))
- (setq d (/ d f))
- (while (and
- (if d (setq p0 (getpoint "\n框选对象第一对角点(会以此点做为延伸方向):")))
- (if p0 (setq p1 (getcorner p0 "\n框选对象另一对角点:")))
- (if (and p0 p1)(setq ss (ssget "c" p0 p1 '((0 . "LINE,ARC,ELLIPSE,*POLYLINE")))))
- )
- (progn
- (command "lengthen" "de" d)
- (repeat (setq n (sslength ss))
- (command (list (setq e (ssname ss (setq n (1- n)))) p0))
- )
- (command "")
- )
- (setq p0 nil p1 nil ss nil)
- )
- (princ)
- )
定距延长线,框选还能改成选端点
|