캐드 분류
선 연결하는 리습 관련해서 질문드립니다….
컨텐츠 정보
- 294 조회
- 3 댓글
- 0 추천
- 0 비추천
- 목록
본문
1. 컴퓨터를 포맷후 기존사용 하던 선연결 리습이 먹통이 되어 조언좀 구하려 글 올려봅니다…
리습의 기존 명령어는 jjj 였으며 리습내용은 다음과 같습니다. 리습내용에 변경된 사항은 없었는데 왜 갑자기 인식이 안되는지 알 수 있을까요?….
2.
; 끊어진 두 직선을 하나로 연결시키는 프로그램
(defun C:jjj ()
(setvar "cmdecho" 0)
(princ "nSelect 2 lines to make one ") (setq w1 (ssget))
(setq ll1 (ssname w1 0)) (setq ll2 (ssname w1 1))
(setq l1 (entget (ssname w1 0))) (setq l2 (entget (ssname w1 1)))
(setq x1 (car (setq v1 (cdr (setq k1(assoc 10 l1))))))
(setq y1 (car (cdr v1)))
(setq x2 (car (setq v2 (cdr (setq k2(assoc 11 l1))))))
(setq y2 (car (cdr v2)))
(setq x3 (car (setq v3 (cdr (assoc 10 l2))))) (setq y3 (car (cdr v3)))
(setq x4 (car (setq v4 (cdr (assoc 11 l2))))) (setq y4 (car (cdr v4)))
(setq d1 (+ (abs (- x1 x3)) (abs (- y1 y3))))
(setq d2 (+ (abs (- x1 x4)) (abs (- y1 y4))))
(if (> d1 d2) (progn (setq d3 (+ (abs (- x2 x3)) (abs (- y2 y3))))
(if (> d1 d3) (setq xh1 x1 yh1 y1 xl1 x3 yl1 y3))
(if (< d1 d3) (setq xh1 x2 yh1 y2 xl1 x3 yl1 y3)) ))
(if (< d1 d2) (progn (setq d3 (+ (abs (- x2 x4)) (abs (- y2 y4))))
(if (> d2 d3) (setq xh1 x1 yh1 y1 xl1 x4 yl1 y4))
(if (< d2 d3) (setq xh1 x2 yh1 y2 xl1 x4 yl1 y4)) ))
(entdel ll2) (setq l1 (subst (cons 10 (list xh1 yh1)) k1 l1))
(setq l1 (subst (cons 11 (list xl1 yl1)) k2 l1)) (entmod l1) (prin1)
(setq w1 nil ll1 nil ll2 nil l1 nil)
(prin1)
)
;;;;;;;all join
(defun c:jj ( / se)
(setvar "cmdecho" 0)
(while (setq se (ssget "x" '((0 . "line"))))
(command "pedit" (ssname se 0) "y" "j" "all" "" "")
)
(princ)
)
관련자료
댓글 3