비밀번호를 잊으셨나요?

비밀번호를 잊으셨나요? 비밀번호를 재설정하려면 이메일 주소를 입력해주세요.

계정이 있나요? 로그인

You must login to ask a question.

비밀번호를 잊으셨나요?

아직 계정이 없으신가요? 회원가입 하기

해당 질문을 신고하는 이유를 간단히 입력해주세요.

해당 답변을 신고하는 이유를 간단히 입력해주세요.

해당 유저를 신고하는 이유를 간단히 입력해주세요.

로그인회원가입

고캐드 – 캐드(CAD) 정보의 중심

고캐드 – 캐드(CAD) 정보의 중심 Logo 고캐드 – 캐드(CAD) 정보의 중심 Logo

고캐드 – 캐드(CAD) 정보의 중심 Navigation

  • Q&A
    • AutoCAD & CADian
    • Inventor & Solidworks
    • Revit & ArchiCAD
    • 자유질문
    • 기타
  • 커뮤니티
    • 오늘의이슈
    • 자유게시판
    • 익명게시판
    • 건의게시판
  • 자료실
    • 자료요청
    • 일반파일
    • 도면샘플
    • 유틸리티
    • 기타
  • 작품 갤러리
    • 그래픽
    • 캐드도면
    • 3D모델
    • 기타
  • 뉴스&이벤트
    • 공지사항
    • 뉴스
    • 전시/행사
    • 이벤트
    • 기타
검색
질문하기

Mobile menu

닫기
질문하기
  • 홈
  • 카테고리
    • AutoCAD & CADian
    • Inventor & Solidworks
    • Revit & ArchiCAD
    • 자유질문
    • 기타
  • 투표
  • 커뮤니티 그룹
  • Q&A
    • AutoCAD & CADian
    • Inventor & Solidworks
    • Revit & ArchiCAD
    • 자유질문
    • 기타
  • 커뮤니티
    • 오늘의이슈
    • 자유게시판
    • 익명게시판
    • 건의게시판
  • 자료실
    • 자료요청
    • 일반파일
    • 도면샘플
    • 유틸리티
    • 기타
  • 작품 갤러리
    • 그래픽
    • 캐드도면
    • 3D모델
    • 기타
  • 뉴스&이벤트
    • 공지사항
    • 뉴스
    • 전시/행사
    • 이벤트
    • 기타
홈/ 질문/Q 113656
다음
캐드수제자
캐드수제자Lv.0
등록일: 2022-02-252022-02-25T21:50:16+09:00 2022-02-25T21:50:16+09:00카테고리: AutoCAD & CADian

탭 리습 문의드립니다.

제가 현재 쓰고 있는 탭 작도 리습입니다. 다른건 문제없는데, 정면도 탭 작도시 중심선이 위아래 2mm씩 돌출됩니다. 이걸 1mm씩만 돌출되게 변경이 될까요?? 

(setq tap_draw_layer_1 “0”
;;;외형선
      tap_draw_layer_2
         “3”
;;;실선
      tap_draw_layer_3
         “2”
;;;은선
      tap_draw_layer_4
         “1”
;;;중심선
)
(defun c:tt (/ old_bl old_cm old_lay ok ok1)
  (setq old_bl (getvar “BLIPMODE”)
 old_cm (getvar “cmdecho”)
 old_lay (getvar “clayer”)
  )
  (defun *error* (msg)
    (SETVAR “BLIPMODE” old_bl)
    (SETVAR “cmdecho” old_cm)
    (setvar “clayer” old_lay)
  )
  (SETVAR “BLIPMODE” 0)
  (SETVAR “cmdecho” 0)
  (tap_draw_dcl)
  (if (or (= ok 1) (= ok1 1))
    (progn
      (cond
 ((= tap_draw_dia 2.5) (setq tap_draw_p 0.45)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 2) 2 2)))
 ((= tap_draw_dia 3) (setq tap_draw_p 0.6)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 2) 2 2)))
 ((= tap_draw_dia 4) (setq tap_draw_p 0.75)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 2) 2 2)))
 ((= tap_draw_dia 5) (setq tap_draw_p 0.8)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 3) 2 2)))
 ((= tap_draw_dia 6) (setq tap_draw_p 1)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 3) 2 2)))
 ((= tap_draw_dia 8) (setq tap_draw_p 1.25)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 3) 2 2)))
 ((= tap_draw_dia 10) (setq tap_draw_p 1.5)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 5) 2 2)))
 ((= tap_draw_dia 12) (setq tap_draw_p 1.75)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 5) 2 2)))
 ((= tap_draw_dia 14) (setq tap_draw_p 2)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 5) 2 2)))
 ((= tap_draw_dia 16) (setq tap_draw_p 2)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 7) 2 2)))
 ((= tap_draw_dia 18) (setq tap_draw_p 2.5)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 7) 2 2)))
 ((= tap_draw_dia 20) (setq tap_draw_p 2.5)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 7) 2 2)))
 ((= tap_draw_dia 22) (setq tap_draw_p 2.5)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 10) 2 2)))
 ((= tap_draw_dia 24) (setq tap_draw_p 3)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 10) 2 2)))
 ((= tap_draw_dia 30) (setq tap_draw_p 3.5)(setq tap_draw_type_2 (rtos  (+ (atof tap_draw_type_4) 10) 2 2)))
      )
      (tap_draw_layer_1_make)
      (tap_draw_layer_2_make)
      (tap_draw_layer_3_make)
      (tap_draw_layer_4_make)
      (setvar “clayer” old_lay)
      (cond
 ((= tap_draw_type_1 “0”) (tap_draw_top))
 ((= tap_draw_type_1 “1”) (tap_draw_through))
 ((= tap_draw_type_1 “2”) (tap_draw_blind))
      )
    )
  )
  (SETVAR “BLIPMODE” old_bl)
  (SETVAR “cmdecho” old_cm)
  (PRINC)
)
;;;********************************************
;;; 은선/중심선의 레이어 축척을 설정           
;;;********************************************
(defun dxf_48_setting (dxf_48 /)
  (if (> dxf_48 1)
    (setq dxf_48 1)
  )
  dxf_48
)
;;;********************************************
;;;                블럭 체인지                 
;;;********************************************
(defun block_change (block_change_ss    block_change_name
       /      block_change_ss
       block_change_name    block_change_p
      )
  (setq block_change_p 0)
  (while (ssname block_change_ss block_change_p)
    (setq block_change_1 (subst
      (cons 2 block_change_name)
      (assoc
        2
        (entget (ssname block_change_ss block_change_p)
        )
      )
      (entget (ssname block_change_ss block_change_p))
    )
   block_change_p (+ block_change_p 1)
    )
    (entmod block_change_1)
  )
)
;;;************************************
(defun tap_draw_top (/ pt ss)
  (defun tap_draw_top_1 (draw_pt / draw_pt)
    (if (= tap_draw_type_7 “1”)
      (progn
 (if (< (/ tap_draw_dia 5.0) 1)
   (entmake(list ‘(0 . “CIRCLE”)
(cons 8 tap_draw_layer_3)
(CONS 48 (dxf_48_setting (/ tap_draw_dia 5.0)))
(cons 10 draw_pt)
(cons 40 (/ (- tap_draw_dia tap_draw_p) 2.0))))
   (entmake (list ‘(0 . “CIRCLE”)
  (cons 8 tap_draw_layer_3)
  (cons 10 draw_pt)
  (cons 40 (/ (- tap_draw_dia tap_draw_p) 2.0))))))
      (progn
(entmake (list ‘(0 . “CIRCLE”)
       (cons 8 tap_draw_layer_1)
       (cons 10 draw_pt)
       (cons 40 (/ (- tap_draw_dia tap_draw_p) 2.0))))
)
      )
    (COND ((= tap_draw_type_7 “1”)
   (entmake (list (cons 0 “ARC”)
  (cons 8 tap_draw_layer_3)
  (cons 10 draw_pt)
  (cons 40 (/ tap_draw_dia 2.0))
  (Cons 50 (* pi 1.45))
  (cons 51 (* pi 1.05))
  )
    )
   )
  ((/= tap_draw_type_7 “1”)
   (entmake (list (cons 0 “ARC”)
  (cons 8 tap_draw_layer_2)
  (cons 10 draw_pt)
  (cons 40 (/ tap_draw_dia 2.0))
  (Cons 50 (* pi 1.45))
  (cons 51 (* pi 1.05))
  )
    )
   )
  )
    
  
    (if (= tap_draw_type_8 “1”)
      (progn
 (entmake
   (LIST
     (CONS 0 “LINE”)
     (CONS 8 tap_draw_layer_4)
     ;(CONS 48 (dxf_48_setting (/ tap_draw_dia 50.0)))
     (CONS 10
    (polar draw_pt pi (+ (/ tap_draw_dia 2.0) 0))
     )
     (CONS 11
    (polar draw_pt 0 (+ (/ tap_draw_dia 2.0) 0))
     )
   )
 )
 (entmake
   (LIST (CONS 0 “LINE”)
  (CONS 8 tap_draw_layer_4)
  ;(CONS 48 (dxf_48_setting (/ tap_draw_dia 50.0)))
  (CONS 10
        (polar draw_pt
        (* pi 1.5)
        (+ (/ tap_draw_dia 2.0) 0)
        )
  )
  (CONS 11
        (polar draw_pt
        (* pi 0.5)     
        (+ (/ tap_draw_dia 2.0) 0)
        )
  )
   )
 )
      )
    )
  )
  (if (= tap_draw_type_5 “0”)
    (progn
      (while (/= (setq pt (getpoint “n삽입점:”)) nil)
 (tap_draw_top_1 (trans pt 1 0))
      )
    )
    (progn
      (setq block_name (STRCAT “M” (RTOS tap_draw_dia) ” TAP”))
      (if (= tap_draw_type_7 “1”)
 (setq block_name (strcat block_name “(H)”))
      )
      (if
 (= (tblsearch “block” block_name)
    nil
 )
  (progn
    (entmake
      (list ‘(0 . “BLOCK”)
     (cons 2 block_name)
     ‘(70 . 0)
     ‘(10 0.0 0.0 0.0)
      )
    )
    (tap_draw_top_1 (list 0 0 0))
    (entmake ‘((0 . “ENDBLK”)))
  )
      )
      (if (= tap_draw_type_6 “0”)
 (progn
   (prompt “n삽입점/취소=Esc/:”)
   (while (/= (vl-cmdf “_insert” block_name pause “” “” 0)
       nil
   )
   )
 )
 (progn
   (prompt “n교체할 부분 선택:”)
   (setq ss (ssget ‘((0 . “INSERT”))))
   (if ss
     (block_change ss block_name)
   )
 )
      )
    )
  )
)
;;;***************************************
(defun tap_draw_through (/
    tap_draw_through_pt1
    tap_draw_through_pt2
    tap_draw_through_dist
    tap_draw_layer
    block_name
    tap_draw_through_angle
   )
  (defun tap_draw_through1 (pt1    pt_dist  pt_angle      /
       pt1    pt2   pt4  pt5 pt6    pt7
       pt8    pt9   pt10  pt11 pt12   pt13
       pt14   pt15   pt_angle
      )
    (setq pt2 (polar pt1 pt_angle pt_dist))
    (if (= tap_draw_type_7 “1”)
      (setq tap_draw_layer tap_draw_layer_3)
      (setq tap_draw_layer tap_draw_layer_1)
    )
    (setq pt3  (polar (polar pt1
        (+ pt_angle (* pi 0.5))
        (/ (- tap_draw_dia tap_draw_p) 2.0)
        )
        pt_angle
        (/ tap_draw_p 2.0)
        )
   pt4  (polar pt3 pt_angle (- pt_dist tap_draw_p))
   pt5  (polar pt3
        (- pt_angle (* pi 0.5))
        (- tap_draw_dia tap_draw_p)
        )
   pt6  (polar pt4
        (- pt_angle (* pi 0.5))
        (- tap_draw_dia tap_draw_p)
        )
   pt7  (polar pt1 (+ pt_angle (* pi 0.5)) (/ tap_draw_dia 2.0))
   pt8  (polar pt7 pt_angle pt_dist)
   pt9  (polar pt1 (- pt_angle (* pi 0.5)) (/ tap_draw_dia 2.0))
   pt10 (polar pt9 pt_angle pt_dist)
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt3)
     (cons 11 pt4)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt5)
     (cons 11 pt6)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt7)
     (cons 11 pt3)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt3)
     (cons 11 pt5)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt5)
     (cons 11 pt9)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt8)
     (cons 11 pt4)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt4)
     (cons 11 pt6)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt6)
     (cons 11 pt10)
      )
    )
    (tap_draw_layer_2_make)
    (if
      (or (= tap_draw_type_3 “1”)
   (and (= tap_draw_type_3 “0”)
        (<= (- pt_dist (/ tap_draw_p 2.0)) (atof tap_draw_type_4))
   )
      )
       (progn
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt7)
   (cons 11 pt8)
    )
  )
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt9)
   (cons 11 pt10)
    )
  )
       )
       (progn
  (setq pt11 (polar pt1
      (+ pt_angle (* pi 0.5))
      (/ tap_draw_dia 2.0)
      )
        pt12 (polar pt11 pt_angle (atof tap_draw_type_4))
        pt13 (polar pt1
      (- pt_angle (* pi 0.5))
      (/ tap_draw_dia 2.0)
      )
        pt14 (polar pt13 pt_angle (atof tap_draw_type_4))
        pt15 (polar (polar pt12 pt_angle (/ tap_draw_p 2.0))
      (- pt_angle (* pi 0.5))
      (/ tap_draw_p 2.0)
      )
        pt16 (polar pt15
      (- pt_angle (* pi 0.5))
      (- tap_draw_dia tap_draw_p)
      )
  )
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt11)
   (cons 11 pt12)
    )
  )
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt13)
   (cons 11 pt14)
    )
  )
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt12)
   (cons 11 pt15)
    )
  )
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt14)
   (cons 11 pt16)
    )
  )
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt12)
   (cons 11 pt14)
    )
  )
  (entmake (LIST (cons 0 “LINE”)
   (cons 8 tap_draw_layer_2)
   (cons 10 pt15)
   (cons 11 pt16)
    )
  )
       )
    )
    (if (= tap_draw_type_8 “1”)
      (progn
 (tap_draw_layer_4_make)
 (entmake
   (LIST (CONS 0 “LINE”)
  (CONS 8 tap_draw_layer_4)
  ;(CONS 48 (dxf_48_setting (/ pt_dist 50.0)))
  (CONS 10 (polar pt1 (+ pt_angle pi) 2.0))
  (CONS 11 (polar pt2 pt_angle 2.0))
   )
 )
      )
    )
  )
  (if (and (/= (setq tap_draw_through_pt1 (getpoint “n삽입점:”)) nil)
    (/= (setq tap_draw_through_pt2
        (getpoint tap_draw_through_pt1
    “n거리/방향:”
        )
        )
        nil
    )
      )
    (progn
      (setq tap_draw_through_angle
      (angle tap_draw_through_pt1
      tap_draw_through_pt2
      )
     tap_draw_through_dist
      (DISTANCE tap_draw_through_pt1
         tap_draw_through_pt2
      )
      )
      (if (= tap_draw_type_5 “0”)
 (progn
   (tap_draw_through1
     (trans tap_draw_through_pt1 1 0)
     tap_draw_through_dist
     tap_draw_through_angle
   )
   (while
     (/= (setq tap_draw_through_pt1 (getpoint “n삽입점:”)) nil)
      (tap_draw_through1
        (trans tap_draw_through_pt1 1 0)
        tap_draw_through_dist
        tap_draw_through_angle
      )
   )
 )
 (progn
   (if (or (= tap_draw_type_3 “1”)
    (and (= tap_draw_type_3 “0”)
         (<= (- tap_draw_through_dist (/ tap_draw_p 2.0))
      (atof tap_draw_type_4)
         )
    )
       )
     (setq block_name
     (strcat “M”
      (rtos tap_draw_dia)
      ” TAP “
      (RTOS tap_draw_through_dist)
      “t관통”
     )
     )
     (setq block_name
     (strcat “%%C”
      (rtos (- tap_draw_dia tap_draw_p))
      ” “
      (RTOS tap_draw_through_dist)
      “t관통후 M”
      (rtos tap_draw_dia)
      ” TAP X “
      tap_draw_type_4
      ” depth”
     )
     )
   )
   (if (= tap_draw_type_7 “1”)
     (setq block_name (strcat block_name “(H)”))
   )
   (if (= (tblsearch “block” block_name) nil)
     (progn
       (entmake (list (cons 0 “BLOCK”)
        (cons 2 block_name)
        (cons 70 0)
        (cons 10 (list 0.0 0.0 0.0))
         )
       )
       (tap_draw_through1
  (list 0 0 0)
  tap_draw_through_dist
  (* pi 1.5)
       )
       (entmake ‘((0 . “ENDBLK”)))
     )
   )
   (if (= tap_draw_type_6 “0”)
     (progn
       (vl-cmdf
  “_insert”
  block_name
  tap_draw_through_pt1
  “”
  “”
  (/ 360
     (/ (* 2.0 pi) (+ tap_draw_through_angle (* pi 0.5)))
  )
       )
       (prompt “n삽입점/취소=Esc/:”)
       (while
  (/= (vl-cmdf
        “_insert”
        block_name
        pause
        “”
        “”
        (/ 360
    (/ (* 2.0 pi)
       (+ tap_draw_through_angle (* pi 0.5))
    )
        )
      )
      nil
  )
       )
     )
     (progn
       (prompt “n교체할 부분 선택:”)
       (setq ss (ssget ‘((0 . “INSERT”))))
       (if ss
  (block_change ss block_name)
       )
     )
   )
 )
      )
    )
  )
)
;;;*********************************
(defun tap_draw_blind (/
         tap_draw_blind_pt
         tap_draw_blind_angle
         tap_draw_blind_angle_1
         tap_draw_blind_angle_2
         block_name
        )
  (defun tap_draw_blind1 (pt    pt_angle /      tap_draw_layer
     pt    pt_angle pt1      pt2      pt3
     pt4    pt5     pt6      pt7      pt8
     pt9    pt10     pt11
    )
    (if (= tap_draw_type_7 “1”)
      (progn
 (setq tap_draw_layer tap_draw_layer_3)
 (tap_draw_layer_3_make)
      )
      (progn
 (setq tap_draw_layer tap_draw_layer_1)
 (tap_draw_layer_1_make)
      )
    )
    (setq pt1 (polar (polar pt
       (+ pt_angle (* pi 0.5))
       (/ (- tap_draw_dia tap_draw_p) 2.0)
       )
       pt_angle
       (/ tap_draw_p 2.0)
       )
   pt2 (polar pt1
       pt_angle
       (- (atof tap_draw_type_2) (/ tap_draw_p 2.0))
       )
   pt3 (polar pt1
       (- pt_angle (* pi 0.5))
       (- tap_draw_dia tap_draw_p)
       )
   pt4 (polar pt2
       (- pt_angle (* pi 0.5))
       (- tap_draw_dia tap_draw_p)
       )
   pt5 (polar
  (polar pt2
         pt_angle
         (sqrt (- (expt (/ (/ (- tap_draw_dia tap_draw_p) 2.0)
      (cos (* (/ pi 180) 31))
          )
          2
    )
    (expt (/ (- tap_draw_dia tap_draw_p) 2.0) 2)
        )
         )
  )
  (- pt_angle (* pi 0.5))
  (/ (- tap_draw_dia tap_draw_p) 2.0)
       )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt1)
     (cons 11 pt2)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt3)
     (cons 11 pt4)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt2)
     (cons 11 pt5)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt4)
     (cons 11 pt5)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt2)
     (cons 11 pt4)
      )
    )
    (tap_draw_layer_2_make)
    (if (= tap_draw_tyep_1 “2”)
;(or (= tap_draw_type_3 “1”)
    ; (and (= tap_draw_type_3 “0”)
  ; (<= (- (atof tap_draw_type_2) (/ tap_draw_p 2.0))
       ;(atof tap_draw_type_4)
  ; )
     😉
 😉
      (progn
 (setq pt6 (polar pt
    (+ pt_angle (* pi 0.5))
    (/ tap_draw_dia 2.0)
    )
       pt7 (polar pt6 pt_angle (atof tap_draw_type_2))
       pt8 (polar pt
    (- pt_angle (* pi 0.5))
    (/ tap_draw_dia 2.0)
    )
       pt9 (polar pt8 pt_angle (atof tap_draw_type_2))
 )
 (entmake (LIST (cons 0 “LINE”)
         (cons 8 tap_draw_layer_2)
         (cons 10 pt6)
         (cons 11 pt7)
   )
 )
 (entmake (LIST (cons 0 “LINE”)
         (cons 8 tap_draw_layer_2)
         (cons 10 pt8)
         (cons 11 pt9)
   )
 )
 (entmake (LIST (cons 0 “LINE”)
         (cons 8 tap_draw_layer_2)
         (cons 10 pt7)
         (cons 11 pt2)
   )
 )
 (entmake (LIST (cons 0 “LINE”)
         (cons 8 tap_draw_layer_2)
         (cons 10 pt9)
         (cons 11 pt4)
   )
 )
      )
      (progn
 (setq pt6  (polar pt
     (+ pt_angle (* pi 0.5))
     (/ tap_draw_dia 2.0)
     )
       pt7  (polar pt6 pt_angle (atof tap_draw_type_4))
       pt8  (polar pt
     (- pt_angle (* pi 0.5))
     (/ tap_draw_dia 2.0)
     )
       pt9  (polar pt8 pt_angle (atof tap_draw_type_4))
       pt10 (polar (polar pt7 pt_angle (/ tap_draw_p 2.0 (/ (sin (* pi (/ 30 180.))) (cos (* pi (/ 30 180.))))));각도조절1
     (- pt_angle (* pi 0.5))
     (/ tap_draw_p 2.0)
     )
       pt11 (polar (polar pt9 pt_angle (/ tap_draw_p 2.0 (/ (sin (* pi (/ 30 180.))) (cos (* pi (/ 30 180.))))));각도조절2
     (+ pt_angle (* pi 0.5))
     (/ tap_draw_p 2.0)
     )
 )
 (entmake (LIST (cons 0 “LINE”)
         (cons 8 tap_draw_layer_2)
         (cons 10 pt6)
         (cons 11 pt7)
   )
 )
 (entmake (LIST (cons 0 “LINE”)
         (cons 8 tap_draw_layer_2)
         (cons 10 pt8)
         (cons 11 pt9)
   )
 )
 (entmake (LIST (cons 0 “LINE”)
         (cons 8 tap_draw_layer_2)
         (cons 10 pt7)
         (cons 11 pt10)
   )
 )
 (entmake (LIST (cons 0 “LINE”);1
         (cons 8 tap_draw_layer_2)
         (cons 10 pt7)
         (cons 11 pt10);<-각도점1
   )
 )
 (entmake (LIST (cons 0 “LINE”);2
         (cons 8 tap_draw_layer_2)
         (cons 10 pt9)
         (cons 11 pt11);<-각도점2
   )
 )
 ;(vl-cmdf “circle” pt7 0.1)
 ;(vl-cmdf “circle” pt9 0.1)
 (entmake (LIST (cons 0 “LINE”);red2white
         (cons 8 tap_draw_layer)
         (cons 10 pt7)
         (cons 11 pt9)
   )
 )
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt1)
     (cons 11 pt6)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt1)
     (cons 11 pt3)
      )
    )
    (entmake (LIST (cons 0 “LINE”)
     (cons 8 tap_draw_layer)
     (cons 10 pt3)
     (cons 11 pt8)
      )
    )
    (if (= tap_draw_type_8 “1”)
      (progn
 (tap_draw_layer_4_make)
 (entmake
   (LIST (CONS 0 “LINE”)
  (CONS 8 tap_draw_layer_4)
 ; (CONS 48 (dxf_48_setting (/ tap_draw_dia 50.0)))
  (CONS 10 (polar pt (+ pt_angle pi) 2.0))
  (CONS 11 (polar pt5 pt_angle 2.0))
   )
 )
      )
    )
  )
  (setq tap_draw_blind_pt (getpoint “n삽입점:”))
  (if (= tap_draw_blind_angle nil)
    (setq tap_draw_blind_angle_1 (* pi 1.5))
    (setq tap_draw_blind_angle_1 tap_draw_blind_angle)
  )
  (if (EQUAL tap_draw_blind_angle_1 0 0.000001)
    (setq tap_draw_blind_angle_2 0)
    (setq tap_draw_blind_angle_2
    (/ 360 (/ (* pi 2) tap_draw_blind_angle_1))
    )
  )
  (setq tap_draw_blind_angle
  (GETANGLE tap_draw_blind_pt
     (strcat “n방향=>삽입각도/<<“
      (rtos tap_draw_blind_angle_2)
      “>>:”
     )
  )
  )
  (if (= tap_draw_blind_angle nil)
    (setq tap_draw_blind_angle tap_draw_blind_angle_1)
  )
  (if (= tap_draw_type_5 “0”)
    (progn
      (while (/= tap_draw_blind_pt nil)
 (tap_draw_blind1
   (trans tap_draw_blind_pt 1 0)
   tap_draw_blind_angle
 )
 (setq tap_draw_blind_pt (getpoint “n삽입점:”))
      )
    )
    (progn
      (if (or (= tap_draw_type_3 “1”)
       (and (= tap_draw_type_3 “0”)
     (<= (- (atof tap_draw_type_2) (/ tap_draw_p 2.0))
         (atof tap_draw_type_4)
     )
       )
   )
 (setq block_name
        (strcat “%%C”
         (rtos (- tap_draw_dia tap_draw_p))
         ” X “
         tap_draw_type_2
         ” depth후 M”
         (rtos tap_draw_dia)
         ” TAP”
        )
 )
 (setq block_name
        (strcat “%%C”
         (rtos (- tap_draw_dia tap_draw_p))
         ” X “
         tap_draw_type_2
         ” depth후 M”
         (rtos tap_draw_dia)
         ” TAP X “
         tap_draw_type_4
         ” depth”
        )
 )
      )
      (if (= tap_draw_type_7 “1”)
 (setq block_name (strcat block_name “(H)”))
      )
      (if (= (tblsearch “block” block_name) nil)
 (progn
   (entmake (list (cons 0 “BLOCK”)
    (cons 2 block_name)
    (cons 70 0)
    (cons 10 (list 0.0 0.0 0.0))
     )
   )
   (tap_draw_blind1 (list 0 0 0) (* pi 1.5))
   (entmake ‘((0 . “ENDBLK”)))
 )
      )
      (if (= tap_draw_type_6 “0”)
 (progn
   (vl-cmdf
     “_insert”
     block_name
     tap_draw_blind_pt
     “”
     “”
     (/ 360 (/ (* 2.0 pi) (+ tap_draw_blind_angle (* pi 0.5))))
   )
   (prompt “n삽입점/취소=Esc/:”)
   (while
     (/= (vl-cmdf
    “_insert”
    block_name
    pause
    “”
    “”
    (/ 360
       (/ (* 2.0 pi) (+ tap_draw_blind_angle (* pi 0.5)))
    )
  )
  nil
     )
   )
 )
 (progn
   (prompt “n교체할 부분 선택:”)
   (setq ss (ssget ‘((0 . “INSERT”))))
   (if ss
     (block_change ss block_name)
   )
 )
      )
    )
  )
)
;;;******************************
(defun tap_draw_layer_1_make (/)
  (if (= (TBLSEARCH “LAYER” tap_draw_layer_1) nil)
    (COMMAND “-LAYER”   “MAKE”       tap_draw_layer_1
      “COLOR”   “7”        “”     “ltype”
      “Continuous” “”        “”
     )
  )
)
(defun tap_draw_layer_2_make (/)
  (if (= (TBLSEARCH “LAYER” tap_draw_layer_2) nil)
    (COMMAND “-LAYER”   “MAKE”       tap_draw_layer_2
      “COLOR”   “1”        “”     “ltype”
      “Continuous” “”        “”
     )
  )
)
(defun tap_draw_layer_3_make (/)
  (if (= (TBLSEARCH “LAYER” tap_draw_layer_3) nil)
    (COMMAND “-LAYER”  “MAKE”      tap_draw_layer_3
      “COLOR”  “2”      “”   “ltype”
      “hidden”  “”      “”
     )
  )
)
(defun tap_draw_layer_4_make (/)
  (if (= (TBLSEARCH “LAYER” tap_draw_layer_4) nil)
    (COMMAND “-LAYER”  “MAKE”      tap_draw_layer_4
      “COLOR”  “1”      “”   “ltype”
      “center”  “”      “”
     )
  )
)
(defun tap_draw_dcl (/      tap_draw_dcl_name
       tap_draw_dcl_name_1   tap_draw_dcl_name_2
       dcl_id
      )
  (vl-load-com)
  (setq tap_draw_dcl_name
  (vl-filename-mktemp “tap_draw.dcl”)
 tap_draw_dcl_name_1
  (open tap_draw_dcl_name “w”)
 tap_draw_dcl_name_2
  (strcat
    “tap_draw : dialog {
label = ”2D 탭”;
: row {
: boxed_column {
    label = ”탭 유형”;
    width = 15;
    fixed_width = true;
      :row {
     :boxed_radio_column { label = ”도면 상태”;
                                        key = ”tap_draw_type_1”;
         : radio_button { label = ”평면도”; key = ”0”;}
         : radio_button { label = ”정면 관통”; key = ”1”;}
         : radio_button { label = ”정면 깊이”; key = ”2”;}
        }
         spacer_1;
      : text { label = ”    탭 깊이”; }
: edit_box{ key = ”tap_draw_type_4”;    width = 1;}
         spacer_1;
}
: row {
   : toggle { label = ”블럭으로 그리기” ; key = ”tap_draw_type_5”;}
: toggle { label = ”블럭 교체” ; key = ”tap_draw_type_6”;} 
}
spacer_1;
: column{
: toggle { label = ”은선으로 그리기” ; key = ”tap_draw_type_7”;}
: toggle { label = ”중심선으로 그리기” ; key = ”tap_draw_type_8”;}
}
spacer_1;
: row {
: text {label = ”설정 탭규격”; is_bold = true;}
: text {key = ”tap_draw_type_9”; is_bold = true; width = 5;}
      }
}
: boxed_column {
    label = ”탭 사이즈”;
    width = 15;
    fixed_width = true;
: row {
: button {
label = ”M2.5”;
key = ”tap_draw_3”;
width = 5;
height = 1.5;
}
: button {
label = ”M3”;
key = ”tap_draw_4”;
width = 5;
height = 1.5;
}
: button {
label = ”M4”;
key = ”tap_draw_6”;
width = 5;
height = 1.5;
}
}
: row {
: button {
label = ”M5”;
key = ”tap_draw_7”;
width = 5;
height = 1.5;
}
”    “
: button {
label = ”M6”;
key = ”tap_draw_8”;
width = 5;
height = 1.5;
}
: button {
label = ”M8”;
key = ”tap_draw_10”;
width = 5;
height = 1.5;
}
}
: row {
: button {
label = ”M10”;
key = ”tap_draw_11”;
width = 5;
height = 1.5;
}
: button {
label = ”M12”;
key = ”tap_draw_12”;
width = 5;
height = 1.5;
}
: button {
label = ”M14”;
key = ”tap_draw_13”;
width = 5;
height = 1.5;
}
}
: row {
: button {
label = ”M16”;
key = ”tap_draw_14”;
width = 5;
height = 1.5;
}
: button {
label = ”M18”;
key = ”tap_draw_15”;
width = 5;
height = 1.5;
}
: button {
label = ”M20”;
key = ”tap_draw_16”;
width = 5;
height = 1.5;
}
}
”    “
: row {
: button {
label = ”M22”;
key = ”tap_draw_17”;
width = 5;
height = 1.5;
}
: button {
label = ”M24”;
key = ”tap_draw_18”;
width = 5;
height = 1.5;
}
: button {
label = ”M30”;
key = ”tap_draw_20”;
width = 5;
height = 1.5;
}
}
}}
spacer_1;
ok_cancel;
}”)
  )
  (write-line tap_draw_dcl_name_2 tap_draw_dcl_name_1)
  (close tap_draw_dcl_name_1)
  (setq dcl_id (load_dialog tap_draw_dcl_name))
  (if (not (new_dialog “tap_draw” dcl_id))
    (exit)
  )
  (setq ok1 0)
  (if (= tap_draw_type_1 nil)
    (setq tap_draw_type_1 “0”)
  )
  ;(if (= tap_draw_type_2 nil)
    ;(setq tap_draw_type_2 “20”)
 ; )
  (if (= tap_draw_type_3 nil)
    (setq tap_draw_type_3 “1”)
  )
  (if (= tap_draw_type_4 nil)
    ;(setq tap_draw_type_4 tap_draw_type_2)
(setq tap_draw_type_4  “4”  tap_draw_type_2 (rtos (+ (atof tap_draw_type_4) 2)2 2))
  )
  (if (= tap_draw_type_5 nil)
    (setq tap_draw_type_5 “0”)
  )
  (if (= tap_draw_type_1 “0”)
    (if (= tap_draw_type_7 nil)
      (setq tap_draw_type_7 “0”)
    )
    (if (= tap_draw_type_7 nil)
      (setq tap_draw_type_7 “1”)
    )
  )
  (if (= tap_draw_type_8 nil)
    (setq tap_draw_type_8 “1”)
  )
  (if (= tap_draw_dia nil)
    (setq tap_draw_dia 8)
  )
  (SET_TILE “tap_draw_type_1” tap_draw_type_1)
  ;(SET_TILE “tap_draw_type_2” tap_draw_type_2)
  ;(SET_TILE “tap_draw_type_3” tap_draw_type_3)
  (SET_TILE “tap_draw_type_4” tap_draw_type_4)
  (SET_TILE “tap_draw_type_5” tap_draw_type_5)
  (SET_TILE “tap_draw_type_7” tap_draw_type_7)
  (SET_TILE “tap_draw_type_8” tap_draw_type_8)
  (SET_TILE “tap_draw_type_9”
     (strcat “M” (rtos tap_draw_dia))
  )
  (tap_draw_dcl_start)
  (action_tile
    “tap_draw_type_1”
    “(setq tap_draw_type_1 $value tap_draw_type_3 $value)(tap_draw_dcl_start)”
  )
  ;(action_tile
   ; “tap_draw_type_2”
   ; “(setq tap_draw_type_2 $value)(tap_draw_dcl_start)”
 ; )
 ; (action_tile
   ;  “tap_draw_type_3”
   ; “(setq tap_draw_type_3 $value)(tap_draw_dcl_start)”
 ; )
  (action_tile
    “tap_draw_type_4”
    “(setq tap_draw_type_4 $value)(tap_draw_dcl_start)”
  )
  (action_tile
    “tap_draw_type_5”
    “(setq tap_draw_type_5 $value)(tap_draw_dcl_start)”
  )
  (action_tile
    “tap_draw_type_6”
    “(setq tap_draw_type_6 $value)”
  )
  (action_tile
    “tap_draw_type_7”
    “(setq tap_draw_type_7 $value)”
  )
  (action_tile
    “tap_draw_type_8”
    “(setq tap_draw_type_8 $value)”
  )
  (action_tile
    “tap_draw_3”
    “(setq tap_draw_dia 2.5 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_4”
    “(setq tap_draw_dia 3 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_5”
    “(setq tap_draw_dia 3.5 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_6”
    “(setq tap_draw_dia 4 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_7”
    “(setq tap_draw_dia 5 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_8”
    “(setq tap_draw_dia 6 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_10”
    “(setq tap_draw_dia 8 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_11”
    “(setq tap_draw_dia 10 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_12”
    “(setq tap_draw_dia 12 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_13”
    “(setq tap_draw_dia 14 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_14”
    “(setq tap_draw_dia 16 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_15”
    “(setq tap_draw_dia 18 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_16”
    “(setq tap_draw_dia 20 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_17”
    “(setq tap_draw_dia 22 ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_18”
    “(setq tap_draw_dia 24(tap_chk 24) ok1 1)(done_dialog)”
  )
  (action_tile
    “tap_draw_20”
    “(setq tap_draw_dia 30 ok1 1)(done_dialog)”
  )
  (setq ok (start_dialog))
  (done_dialog)
  (unload_dialog dcl_id)
  (vl-file-delete tap_draw_dcl_name)
)
(defun tap_draw_dcl_start (/)
  (if (= tap_draw_type_1 “0”)
    (progn
      (MODE_TILE “tap_draw_type_2” 1)
      (MODE_TILE “tap_draw_type_3” 1)
      (MODE_TILE “tap_draw_type_4” 1)
    )
    (progn
      (if (= tap_draw_type_1 “1”)
 (MODE_TILE “tap_draw_type_2” 1)
 (MODE_TILE “tap_draw_type_2” 0)
      )
     ; (MODE_TILE “tap_draw_type_3” 0)
      (if (= tap_draw_type_3 “2”)
 (progn
   (MODE_TILE “tap_draw_type_4” 0)
   (if  (= tap_draw_type_1 “2”)
     (progn
       (setq tap_draw_type_4 tap_draw_type_4 )
       (MODE_TILE “tap_draw_type_4” 0)
     )
   )
 )
 (MODE_TILE “tap_draw_type_4” 1)
      )
    )
  )
  (if (= tap_draw_type_5 “1”)
    (progn
      (MODE_TILE “tap_draw_type_6” 0)
      (if (= tap_draw_type_6 nil)
 (setq tap_draw_type_6 “0”)
      )a
      (SET_TILE “tap_draw_type_6” tap_draw_type_6)
    )
    (progn
      (MODE_TILE “tap_draw_type_6” 1)
    )
  )
)
(princ)
  • 0
  • 109 조회
공유
  • Facebook

    관련 있는 질문들

    • insert 삽입할때 레이어도 같이 변경가능할까요?
    • 캐드 파일을 PDF로 변환 할 때 문제점 도와주세요 ㅠ
    • 질문오토캐드 라인타입이 너무 많은데 어떻게 정리하나요..
    • 질문오토캐드 라인타입이 너무 많은데 어떻게 정리하나요..

    Sidebar

    질문하기
    공지사항

    • AI CAD의 미래! 캐디안 2025 1+1 프로모션 안내 2025-05-14

    Adv 234x60

    aalan

    Adv 234x60

    aalan

    Adv 120x600

    aalan

    Explore

    • 홈
    • 카테고리
      • AutoCAD & CADian
      • Inventor & Solidworks
      • Revit & ArchiCAD
      • 자유질문
      • 기타
    • 투표
    • 커뮤니티 그룹
    aalan

    Footer

    Support

    • 회사 및 서비스 소개
    • 자주 묻는 질문
    • 문의하기

    Guide

    • 제휴/협업 안내
    • 광고 서비스 안내

    Policy

    • 서비스 이용약관
    • 개인정보 처리방침
    • 광고성 정보 수신 동의

    Contents

    • 고밍스토리
    • 리습 시리즈

    정소프트 | 사업자등록번호 : 677-40-00198 | 대표 : 정은숙 | 이메일 : gocad.manager@gmail.com
    주소 : 서울특별시 강서구 양천로 400-12, 6층 614,615,617호(등촌동, 더리브골드타워)
    Copyright. 2012-2024 GOCAD All rights reserved