무더운 날씨에 고생이 많으십니다.
덕트 작성하고 엘보 생성하는 리습인데 작동이 잘되지 않아 문의 드립니다.
GPT도 해결을 못해주네요,..ㅠㅠㅠ
선배님 도움 요청 드립니다.
(defun c:rr (/ ss en1 en2 width offset rad arc acadObj doc modelSpace
vlaArc offsetOut offsetIn ratio ratioInput)
(vl-load-com) ;; Visual LISP 모듈 로드
(prompt “\\n?? 2-LINE DUCT 엘보 생성 시작”)
;; 중심선 선택
(setq ss (ssget ‘((0 . “LINE”))))
(if (or (not ss) (/= (sslength ss) 2))
(progn
(prompt “\\n? 중심선 2개를 선택해주세요.”)
(exit)
)
)
;; DUCT 폭 입력
(setq width (getreal “\\nDUCT 폭(mm)? 예: 100 → “))
(if (not width) (setq width 100))
(setq offset (/ width 2.0))
;; ?? 반지름 비율 입력 (기본값 1.0)
(prompt (strcat “\\n필렛 반지름 비율 설정? <기본값: 1.0>: “))
(setq ratioInput (getreal))
(setq ratio (if ratioInput ratioInput 1.0))
(setq rad (* width ratio)) ;; ?? 핵심 계산
;; 중심선 가져오기
(setq en1 (ssname ss 0))
(setq en2 (ssname ss 1))
;; 필렛 적용
(command “FILLET” “R” rad)
(command “FILLET” en1 en2)
(setq arc (entlast))
;; 객체 참조 준비
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq modelSpace (vla-get-ModelSpace doc))
(setq vlaArc (vlax-ename->vla-object arc))
;; 아크 offset
(setq offsetOut (vla-Offset vlaArc (float offset)))
(setq offsetIn (vla-Offset vlaArc (float (- offset))))
(command “change” en “” “p” “c” “BYL” “lt” “BYL” “”)
;; FILLET R 초기화
(command “FILLET” “R” 0)
(prompt (strcat “\\n? R값 = DUCT 폭 × ” (rtos ratio 2 2) ” = ” (rtos rad 2 2)))
(prompt “\\n? 중심선 필렛 + 자동 2줄 offset 완료!”)
(princ)
)
- 덕트 그리고 중심선 필렛해서 옵셋 까지는 되는데
외각라인 레어어 색상, 라인타입을 현재 레이어 (중심선 동일레이어) 로 수정해야 하는데 어떻게 해야 하나요?
2. END 점에 선을 연결하여 마무리 하고 싶은데 어떻게 해야 하나요?
감사합니다.