철근 샵을 하는 사람인데요
일자 라인에 45도 갈고리를 넣는 리습을 외국사이트에서 찾았는데
단순히 제가 클릭하는 방향에서 45도의 후크(갈고리)를 넣는 방법으로 수정하고 싶습니다
능력자님들 부탁드려요,,ㅠ
이거는 그리고 난이후에 뭐가 더 많은데 어떤걸 지워도 안된다고 나와서요 ㅠ
(defun c:ho ( / plent pt1 pt2 pt3 x pt5 add ang1 ang2)
(while (setq plent (entsel “Pick pline Enter to exit”))
(if plent (setq co-ord (mapcar ‘cdr (vl-remove-if-not ‘(lambda (x) (= (car x) 10)) (entget (car plent))))))
(setq pt1 (nth 0 co-ord)) ; 1st point
(setq pt2 (nth 1 co-ord)) ; second point
(setq x (- (length co-ord) 1)) ; how many points- 1 as 1st point is 0
(setq pt3 (nth (- x 1) co-ord)) ; second last point
(setq pt4 (nth x co-ord)) ; last point
(setq ang1 (angle pt2 pt1)) ; angle ofthe pline
(setq ang2 (angle pt3 pt4))
(setq add (getreal “Enter distance to add on”))
(setq pt5 (polar pt1 (+ (* 0.75 pi) ang1) add)) ; 135 degrees
(command “line” pt1 pt5 “”) ; new line
(setq ans (getstring “is line ok Y or N”)) ; is it in correct direction
(if (= “Y” (strcase ans)) ; y or Y
(princ “ok”)
(command “mirror” “Last” “” pt1 pt2 “Y”) ; flip line
)
(setq pt5 (polar pt4 (+ (* 0.25 pi) ang2) add)) ; other end
(command “line” pt4 pt5 “”)
(setq ans (getstring “is line ok Y or N”))
(if (= “Y” (strcase ans))
(princ “ok”)
(command “mirror” “Last” “” pt4 pt3 “Y”)
)
)
)
(c:ho)
영승짱Lv.0
hook(후크) lisp(리습) 수정좀 부탁드립니다.
공유