하나의 선을 선택후 수치를 입력하면 그값만큼 양쪽으로 길이가 늘어나는 리습인데요..
다중으로 선택이 않됩니다. 다중으로 선택가능하게 수정해 주시면 감사하겠습니다.
; 선택한 선 양쪽 신축(STRETCH))
; 늘이기 : +값 또는 부호 없는값 입력
; 줄이기 : -값 입력
; Line만 가능
; Both STretch : ew
(defun c:ew ( / ss index e obj oldspt oldept newspt newept dist)
(vl-load-com)
(prompt “n 양쪽 늘이기 [ bst ]”)
(setq ss (ssget (list (cons 0 “LINE”))))
(setvar “orthomode” 1)
(setq dist (getdist “n ≫ Input the stretch length : “))
(setq index 0)
(setq e (ssname ss index))
(setq obj (vlax-ename->vla-object e))
(setq oldspt (vlax-get obj ‘startpoint))
(setq oldept (vlax-get obj ‘endpoint))
(setq newspt (polar oldspt (angle oldept oldspt) dist))
(setq newept (polar oldept (angle oldspt oldept) dist))
(vlax-put obj ‘startpoint newspt)
(vlax-put obj ‘endpoint newept)
(setq index (1+ index))
(princ)
) ; end of defun