2012년 12월 22일 토요일

[LISP-GSJ] 다중 필렛(Fillet) 프로그램 (포스트아이디 : 2793236810932122644)


;;=========================================================================================================
;; http://cafe.daum.net/zwcad & http://www.lispcenter.net
;;=========================================================================================================
(defun C:MF( / *error* S1 S2 FilletRadius)
 (defun *error* (msg)
   (princ "\nMF   취소...")
   (princ)
 )
 (setq FilletRadius (getvar "FILLETRAD"))
 (setvar "cmdecho" 0)
 (prompt "\n현재 설정값 : 반지름 = ")
 (princ FilletRadius)
 (initget "Radius")
 (setq S1 (entsel "\n첫 번째 객체 선택 [반지름(R)]:"))
 (while S1
  (cond
   ((= (type S1) 'LIST)
    (setq S2 (entsel "\n두 번째 객체 선택:"))
   )
   ((= S1 "Radius")
    (setq FilletRadius (SetFilletRadius FilletRadius))
   )
   (t
    (princ "\n*유효하지 않은 선택*")
   )
  )
  (if (and (= (type S1) 'LIST) (= (type S2) 'LIST))
   (command "fillet" S1 S2)
  )

  (initget "Radius")
  (setq S1 (entsel "\n첫 번째 객체 선택 [반지름(R)]:"))
 )
 (princ)
)
;;=========================================================================================================
;;=========================================================================================================
;;=========================================================================================================
(defun SetFilletRadius(FilletRadius / FilletRadius)
 (setq TempRadius (getreal (strcat "\n모깎기 반지름 지정 <" (rtos FilletRadius) ">: ")))
 (if (/= TempRadius nil)
  (setq FilletRadius TempRadius )
 )
 (setvar "FILLETRAD" FilletRadius)
 FilletRadius
)
;;=========================================================================================================
;;=========================================================================================================
;;=========================================================================================================
(princ "\nhttp://cafe.daum.net/zwcad  &  http://www.lispcenter.net")
(princ)

댓글 없음:

댓글 쓰기

즐거운 하루되세요...^^