一边延长只有特殊情况下可以满足,象2楼所说的左右,要有参照物,不知具体需求,自己根据代码改吧
- (defun c:lsc (/ os l ss n en pt1 pt2 i l1)
- (setvar "CMDECHO" 0)
- (setq os (getvar "OSMODE"))
- (setvar "OSMODE" 0)
- (if (null ***l***)
- (setq ***l*** "100")
- )
- (setq l (getreal (strcat "\n伸长量<" ***l*** ">:")))
- (if (null l)
- (setq l (atof ***l***))
- )
- (if (= l (fix l))
- (setq ***l*** (rtos l 2 0))
- (progn (setq i 0
- l1 l
- )
- (while (/= l1 (fix l1))
- (setq l1 (* l (expt 10 i))
- i (1+ i)
- )
- )
- (setq ***l*** (rtos l 2 (1- i)))
- )
- )
- (setq ss (ssget '((0 . "lwpolyline,line,arc"))))
- (repeat (setq n (sslength ss))
- (setq en (ssname ss (setq n (1- n)))
- pt1 (vlax-curve-getstartpoint en)
- pt2 (vlax-curve-getendpoint en)
- )
- (command "lengthen" "de" l (list en pt1) (list en pt2) "")
- )
- (setvar "OSMODE" os)
- (princ)
- )
|