캐드 분류
자동트림(TRR) 리습인데 언더를 하면 선택선이 실선이 되어 버리네요 수정 가능할까요?
컨텐츠 정보
- 213 조회
- 0 추천
- 0 비추천
- 목록
본문
자동트림(TRR) 리습인데 언더를 하면
커서로 도형을 선택하면 레이어가 실선이 되어 버리네요 수정 가능할까요?
(defun c:TRR(/ older os orth hig cmd a ss1 tp1 tp2 tp3 tp4 @ang1 @ang2 tp5 tp6 s2 mp k cp ra pt-list)
(setq older *error*)
(defun *error* (msg)
(setvar "OSMODE" os)
(setvar "ORTHOMODE" orth)
(command "undo" "e")
(setq *error* older)
(setvar "CMDECHO" cmd)
(setvar "highlight" hig)
(princ)
)
(setq os (getvar "OSMODE"))
(setq orth (getvar "ORTHOMODE"))
(setq cmd (getvar "cmdecho"))
(setq hig (getvar "highlight"))
(setvar "CMDECHO" 0)
(COMMAND "UNDO" "group")
(setvar "osmode" 0)
(setvar "highlight" 0)
(setvar "orthomode" 0)
(princ " -> BOundary Trim..")
(prompt "n>>영역 트림하기..")
(setq a (getint "n 사각형(1) / 다각형(2) / 원(엔터):"))
(setq ss1 (ssadd))
(command "undo" "be")
(setvar "osmode" 0)
;;————————————————- 사각형
(cond ((= a 1)
(setq tp1 (getpoint "n자르기 first point:"))
(setq tp2 (getcorner tp1 "n자르기 second point:"))
(setq tp3 (list (car tp1) (cadr tp2)))
(setq tp4 (list (car tp2) (cadr tp1)))
(setq @ang1 (angle tp1 tp2) @ang2 (angle tp2 tp1))
(command "pline" tp1 tp4 tp2 tp3 "c")
(ssadd (entlast) ss1)
(setq pt-list (GgetPolyVtx (entget (entlast))))
(setq tp5 (polar tp1 @ang1 0.1)
tp6 (polar tp2 @ang2 0.1)
s2 (ssget "cp" pt-list)
s2 (ssdel (entlast) s2)
mp (polar tp1 @ang1 (/ (distance tp1 tp2) 2))
)
)
;;————————————————- 다각형
((= a 2)
;(command "Undo" "Be") (setvar "osmode" 0)
(setvar "orthomode" 0)
(setq ptlist nil)
(setq ps (getpoint "nt First Point ?:"))
(setq ptb ps) ;; 다각형 시작.
(while (setq pt (getpoint ptb "nt Other Point ?:"))
(grdraw ptb pt 6)
(setq ptlist (append ptlist (list pt)))
(setq ptb pt)
)
(setq ents (ssget "CP" ptlist))
(setq i 1)
(command "Pline" ps "W" 0 0)
(foreach pt ptlist (command pt))
(command "C") ;; 다각형 끝.
(setq ent-tr (entlast))
(setq vtxlist (getpolyvtx (entget ent-tr)))
(setq ps2 (nth 0 vtxlist))
(setq ent-l (entlast))
(setq vtxlist (getpolyvtx (entget ent-tr)))
(ssadd (entlast) ss1)
(setq mp (cdr (assoc 10 (entget (ssname ss1 0)))))
(setq pt-list (GgetPolyVtx (entget (entlast))))
; (setq s2 (ssget "cp" vtxlist)
(setq s2 (ssget "cp" pt-list)
s2 (ssdel (entlast) s2)
)
)
;;————————————————- 원
(t
(setvar "osmode" 55)
(command "circle" "\" "\")
(ssadd (entlast) ss1)
(setq mp (cdr (assoc 10 (entget (ssname ss1 0)))))
(setq ra (cdr (assoc 40 (entget (ssname ss1 0)))))
(command "polygon" 20 mp "i" (- ra 0.1))
(ssadd (entlast) ss1)
(setq pt-list (GgetPolyVtx (entget (entlast))))
(setq s2 (ssget "cp" pt-list)
s2 (ssdel (entlast) s2)
)
(entdel (entlast))
)
);cond
(setq k 0)
(command "trim" "l" "")
(while (ssname s2 k)
(command (list (ssname s2 k) mp))
(setq k (1+ k))
) ;while
(command "")
(command "erase" ss1 "")
(setvar "OSMODE" os)
(setvar "ORTHOMODE" orth)
(setvar "highlight" hig)
(command "undo" "e")
(setq *error* older)
(setvar "CMDECHO" cmd)
(princ)
)
(defun GgetPolyVtx(EntList)
(setq VtxList '())
(foreach x EntList
(if (= (car x) 10)
(setq VtxList (append VtxList (list (cdr x))))
)
)
VtxList
)
관련자료
댓글 0
/ 1 페이지
등록된 댓글이 없습니다.