캐드 분류
선자르기 리습인데요 LINE만되서 PLINE도 가능하게 할려면 어떻게 해야하나요?
컨텐츠 정보
- 166 조회
- 0 추천
- 0 비추천
- 목록
본문
(defun C:BBBK (/ P1 P2 P3 P4 P5 P6 P7 SS1 SS2 INDEX1 INDEX2 ENAME1 ENAME2 ELIST1 ELIST2 BRKLEN OFFDISDAT)
(setq OSMDE (getvar "osmode"))
(setvar "osmode" 0)
(setq PCKBX (getvar "pickbox"))
(setq OFFDISDAT (getstring (strcat "n자르기 할 거리입력: <" OFFDISNUM ">: ")))
(if (/= OFFDISDAT "")
(setq OFFDISNUM OFFDISDAT)
)
(setq BRKLEN (atof OFFDISNUM))
(prompt "n기준선 모두 선택.")
(while (or (not SS1) (= 0 (sslength SS1)))
(setq SS1 (ssget '((0 . "LINE"))))
)
(setq INDEX1 0)
(repeat (sslength SS1)
(progn
(setq ENAME1 (ssname SS1 INDEX1))
(setq ELIST1 (entget ENAME1))
(setq P1 (cdr (assoc 10 ELIST1)))
(setq P2 (cdr (assoc 11 ELIST1)))
(prompt "n자르기할 라인 모두 선택")
(while (or (not SS2) (= 0 (sslength SS2)))
(setq SS2 (ssget '((0 . "LINE"))))
)
(setq INDEX2 0)
(repeat (sslength SS2)
(progn
(setq ENAME2 (ssname SS2 INDEX2))
(setq ELIST2 (entget ENAME2))
(setq P3 (cdr (assoc 10 ELIST2)))
(setq P4 (cdr (assoc 11 ELIST2)))
(setq P5 (inters P1 P2 P3 P4 onseg))
(setq P6 (polar P5 (angle P3 P4) BRKLEN))
(setq P7 (polar P5 (angle P4 P3) BRKLEN))
(command "draworder" ENAME2 "" "F")
(if (= BRKLEN 0)
(command "break" P5 "@")
(command "break" P6 "none" P7)
)
)
(setq INDEX2 (1+ INDEX2))
)
)
(setq INDEX1 (1+ INDEX1))
)
(setvar "osmode" 63)
(princ (strcat "n" (itoa (sslength SS2)) " 개 Line이 자르기 되었습니다."))
(princ)
)
(setq OFFDISNUM "0″)
;;==========================================================================
관련자료
댓글 0
등록된 댓글이 없습니다.