안녕하세요. 공차리습을 잘 쓰고있다가 포멧하고 리셋하였는데 잘못된 인수유형 오류라고 하면서
잘쓰던게 되질않네요.. 뭐가 문제인지 모르겠어요.
도움주셨으면 감사하겠습니다!
첨부가 안되어서 복사할게요!
(defun c:er (/ ss old_bl old_cm old_dimstyle dim_tol_list)
(setq old_bl (GETVAR “BLIPMODE”)
old_cm (GETVAR “cmdecho”)
ok_1 0
)
(defun *error* (msg)
(if (/= (vl-directory-files
(vl-filename-directory dim_tol_dcl_name)
(strcat (vl-filename-base dim_tol_dcl_name)
“.dcl”
)
)
nil
)
(vl-file-delete dim_tol_dcl_name)
)
(if (/= (vl-directory-files
(vl-filename-directory dim_tol_setting_dcl_name)
(strcat (vl-filename-base dim_tol_setting_dcl_name)
“.dcl”
)
)
nil
)
(vl-file-delete dim_tol_setting_dcl_name)
)
(SETVAR “cmdecho” old_cm)
(SETVAR “BLIPMODE” old_bl)
)
(setvar “cmdecho” 0)
(SETVAR “BLIPMODE” 0)
(vl-load-com)
(setq dim_tol_dcl_code 29)
(while (= dim_tol_dcl_code 29)
(setq dim_tol_dcl_code nil)
(dim_tol_data_setting)
(dim_tol_dcl_made)
(dim_tol_dcl)
(vl-file-delete dim_tol_dcl_name)
(if (= dim_tol_dcl_code 29)
(dim_tol_data_setting_dcl_made)
)
)
(if (or (= ok 1) (= ok_1 1))
(progn
(if (= dim_tol_dcl_code 27)
(progn
(prompt “n공차를 삭제할 치수/MTEXT를 선택하시오:”)
(setq ss (ssget ‘((0 . “DIMENSION,MTEXT”))))
(if (/= ss nil)
(progn
(setq p 0)
(while (ssname ss p)
(setq n (ssname ss p)
p (+ p 1)
)
(dim_tol3 n)
);end while
);end progn
); end if
);end progn
(progn
(prompt “n치수/MTEXT를 선택하시오:”)
(setq ss (ssget ‘((0 . “DIMENSION,MTEXT”))))
(if (= dim_tol_dcl_code 28)
(progn
(setq old_dim_tol_tp dim_tol_tp
old_dim_tol_tm dim_tol_tm
n (ssname ss 0)
dim_tol_list (dim_tol_copy n)
)
(if (and (/= (car dim_tol_list) nil)
(/= (cadr dim_tol_list) nil)
)
(progn
(setq ss (ssdel n ss))
(if (> (SSLENGTH ss) 0)
(setq dim_tol_dcl_2 (car dim_tol_list)
dim_tol_dcl_3 (cadr dim_tol_list)
)
)
)
(setq ss nil)
)
)
)
(if (> (SSLENGTH ss) 0)
(progn
(cond
((= (atof (vl-string-left-trim “+-” dim_tol_dcl_2)) 0)
(if (= (nth 25 dim_tol_data) “1”)
(setq dim_tol_tp “+0”)
(setq dim_tol_tp ” 0″)
)
)
((< (atof dim_tol_dcl_2) 0)
(setq dim_tol_tp dim_tol_dcl_2)
)
(T
(SETQ dim_tol_tp
(STRCAT
“+”
(vl-string-left-trim “+-” dim_tol_dcl_2)
)
)
)
)
(cond
((= (atof (vl-string-left-trim “+-” dim_tol_dcl_3)) 0)
(if (= (nth 25 dim_tol_data) “1”)
(setq dim_tol_tm “-0”)
(setq dim_tol_tm ” 0″)
)
)
((= (substr dim_tol_dcl_3 1 1) “+”)
(setq dim_tol_tm dim_tol_dcl_3)
)
(T
(SETQ dim_tol_tm
(STRCAT
“-“
(vl-string-left-trim “+-” dim_tol_dcl_3)
)
)
)
)
(if (EQUAL (atof (vl-string-left-trim “+” dim_tol_tp))
(atof (vl-string-left-trim “-” dim_tol_tm))
0.0000001
)
(setq dim_tol_height (atof (nth 22 dim_tol_data)))
(setq dim_tol_height (atof (nth 21 dim_tol_data)))
)
(if
(EQUAL (atof (vl-string-left-trim “+” dim_tol_tp))
(atof (vl-string-left-trim “-” dim_tol_tm))
0.0000001
)
(progn
(if (= (substr (nth 26 dim_tol_data) 1 1) “1”)
(progn
(setq dim_tol_text
(strcat “{\H”
(rtos dim_tol_height)
“x;\W”
(nth 24 dim_tol_data)
“;\C”
(substr (nth 26 dim_tol_data)
(+ 2
(vl-string-search
“/”
(nth 26 dim_tol_data)
)
)
)
“;%%p”
(rtos (atof dim_tol_tp))
“}”
)
)
)
(progn
(setq dim_tol_text
(strcat “{\H”
(rtos dim_tol_height)
“x;\W”
(nth 24 dim_tol_data)
“;%%p”
(rtos (atof dim_tol_tp))
“}”
)
)
)
)
)
(progn
(if (= (substr (nth 26 dim_tol_data) 1 1) “1”)
(progn
(setq dim_tol_text
(strcat “{\H”
(rtos dim_tol_height)
“x;\W”
(nth 24 dim_tol_data)
“;\C”
(substr (nth 26 dim_tol_data)
(+ 2
(vl-string-search
“/”
(nth 26 dim_tol_data)
)
)
)
“;\S”
dim_tol_tp
“^”
dim_tol_tm
“;}”
)
)
)
(progn
(setq dim_tol_text
(strcat “{\H”
(rtos dim_tol_height)
“x;\W”
(nth 24 dim_tol_data)
“;\S”
dim_tol_tp
“^”
dim_tol_tm
“;}”
)
)
)
)
)
)
(if
(= (atof (vl-string-left-trim “+-” dim_tol_tp)) 0)
(progn
(if (= (nth 25 dim_tol_data) “1”)
(setq dim_tp 0.0000001)
(setq dim_tp 0)
)
)
(setq dim_tp (atof dim_tol_tp))
)
(if
(= (atof (vl-string-left-trim “+-” dim_tol_tm)) 0)
(progn
(if (= (nth 25 dim_tol_data) “1”)
(setq dim_tm 0.0000001)
(setq dim_tm 0)
)
)
(progn
(if (= (substr dim_tol_tm 1 1) “+”)
(setq dim_tm
(atof (strcat
“-“
(vl-string-left-trim “+” dim_tol_tm)
)
)
)
(setq dim_tm
(atof (vl-string-left-trim “+-” dim_tol_tm)
)
)
)
)
)
(setq p 0)
(while (ssname ss p)
(setq n (ssname ss p)
p (+ p 1)
)
(if (= (cdr (assoc 0 (entget n))) “MTEXT”)
(dim_tol1 n)
(progn
(if (= dim_tol_dcl_4 “1”)
(dim_tol1 n)
(dim_tol2 n)
)
)
)
)
)
)
)
)
)
)
(SETVAR “cmdecho” old_cm)
(SETVAR “BLIPMODE” old_bl)
(princ)
)
;;;*******************************************************
;;; MTEXT형 공차
;;;*******************************************************
(defun dim_tol1 (n / n n1 n2 n3 n4 n5 n6 n7 n8 n9 p1)
(setq n1 (entget n)
n2 (assoc 1 n1)
n3 (cdr n2)
)
(if (or (and (= (cdr (assoc 0 n1)) “DIMENSION”)
(= (EQUAL (cdr (assoc 42 n1)) 0 0.000001) nil)
)
(= (cdr (assoc 0 n1)) “MTEXT”)
)
(progn
(if (= (cdr (assoc 0 n1)) “DIMENSION”)
(progn
(vla-put-tolerancedisplay (vlax-ename->vla-object n) 0)
(if (or (= n3 “”) (= n3 nil))
(setq n3 “<>”)
)
)
)
(while (and (/= (setq n5 (vl-string-search “{” n3)) nil)
(/= (setq n6 (vl-string-search “}” n3)) nil)
)
(if (< n6 (- (strlen n3) 1))
(setq n3 (strcat (substr n3 1 n5)
(substr n3 (+ n6 2) (- (strlen n3) n6))
)
)
(setq n3 (substr n3 1 n5))
)
)
(setq n8 “”)
(if (> (atoi (nth 23 dim_tol_data)) 0)
(progn
(setq p1 1)
(while (<= p1 (atoi (nth 23 dim_tol_data)))
(setq n8 (strcat n8 ” “)
p1 (+ p1 1)
)
)
)
)
(if
(and (= (cdr (assoc 0 n1)) “DIMENSION”)
(< (setq n7 (vl-string-search “>” n3)) (- (strlen n3) 1))
)
(setq n9 (subst (cons 1
(strcat (substr n3 1 (+ n7 1))
n8
dim_tol_text
(substr n3 (+ n7 2))
)
)
n2
n1
)
)
(progn
(while (= (substr n3 (strlen n3)) ” “)
(setq n3 (substr n3 1 (- (strlen n3) 1)))
)
(setq n9 (subst (cons 1 (strcat n3 n8 dim_tol_text)) n2 n1))
)
)
(entmod n9)
)
)
)
;;;**********************************************************************
;;; 캐드 공차타입 공차
;;;**********************************************************************
(defun dim_tol2 (n / n n1 n2 n3 n4 n5 n6 n7)
(setq n1 (entget n)
n2 (assoc 1 n1)
n3 (cdr n2)
)
(if (= (EQUAL (cdr (assoc 42 n1)) 0 0.000001) nil)
(progn
(while (and (/= (setq n4 (vl-string-search “{” n3)) nil)
(/= (setq n5 (vl-string-search “}” n3)) nil)
)
(if (< n5 (- (strlen n3) 1))
(setq n3 (strcat (substr n3 1 n4)
(substr n3 (+ n5 2) (- (strlen n3) n5))
)
)
(setq n3 (substr n3 1 n4))
)
)
(setq n6 (subst (cons 1 n3) n2 n1))
(entmod n6)
(setq n7 (vlax-ename->vla-object n))
(if (EQUAL (atof (vl-string-left-trim “+” dim_tol_tp))
(atof (vl-string-left-trim “-” dim_tol_tm))
0.0000001
)
(progn
(vla-put-tolerancedisplay (vlax-ename->vla-object n) 1)
(vla-put-tolerancelowerlimit
(vlax-ename->vla-object n)
dim_tP
)
)
(progn
(vla-put-tolerancedisplay (vlax-ename->vla-object n) 2)
(vla-put-tolerancelowerlimit
(vlax-ename->vla-object n)
dim_tm
)
)
)
(vla-put-toleranceheightscale
(vlax-ename->vla-object n)
dim_tol_height
)
(vla-put-toleranceupperlimit
(vlax-ename->vla-object n)
dim_tp
)
(command “dimedit” “h” n “”)
)
)
)
;;;*******************************************************
;;; 공차 삭제
;;;*******************************************************
(defun dim_tol3 (n / p n n1 n2 n3 n4 n5 n6 n7)
(setq n1 (entget n)
n2 (assoc 1 n1)
n3 (cdr n2)
)
(if (and (/= n3 “”) (/= n3 nil))
(progn
(while (and (/= (setq n5 (vl-string-search “{” n3)) nil)
(/= (setq n6 (vl-string-search “}” n3)) nil)
)
(if (< n6 (- (strlen n3) 1))
(setq n3 (strcat (substr n3 1 n5)
(substr n3 (+ n6 2) (- (strlen n3) n6))
)
)
(setq n3 (substr n3 1 n5))
)
)
(setq n7 (subst (cons 1 n3) n2 n1))
(entmod n7)
)
)
(if (= (cdr (assoc 0 n1)) “DIMENSION”)
(progn
(vla-put-tolerancedisplay (vlax-ename->vla-object n) 0)
(command “dimedit” “h” n “”)
)
)
)
;;;*******************************************************
;;; 공차 복사
;;;*******************************************************
(defun dim_tol_copy (dim_tol_copy_n / dim_text
dim_text_1 dim_text_2 dim_tol_top
dim_tol_min
)
(if (or (and (= (cdr (assoc 0 (entget dim_tol_copy_n))) “DIMENSION”)
(= (vla-get-tolerancedisplay
(vlax-ename->vla-object dim_tol_copy_n)
)
0
)
)
(= (cdr (assoc 0 (entget dim_tol_copy_n))) “MTEXT”)
)
(progn
(if (= (cdr (assoc 0 (entget dim_tol_copy_n))) “MTEXT”)
(setq dim_text (vla-get-textstring
(vlax-ename->vla-object dim_tol_copy_n)
)
)
(setq dim_text (vla-get-textoverride
(vlax-ename->vla-object dim_tol_copy_n)
)
)
)
(if (wcmatch dim_text “*{\H*”)
(progn
(if (wcmatch dim_text “*%%p*”)
(setq dim_text_1 (substr dim_text
(+ (vl-string-search “%%p” dim_text) 4)
)
dim_tol_top (substr dim_text_1
1
(vl-string-search “}” dim_text_1)
)
dim_tol_min dim_tol_top
)
(setq dim_text_1 (substr dim_text
(+ (vl-string-search “\S” dim_text) 3)
)
dim_tol_top (substr dim_text_1
1
(vl-string-search “^” dim_text_1)
)
dim_text_2 (substr dim_text_1
(+ (vl-string-search “^” dim_text_1) 2)
)
dim_tol_min (substr dim_text_2
1
(vl-string-search “;” dim_text_2)
)
)
)
)
(setq dim_tol_top nil
dim_tol_min nil
)
)
)
(progn
(if (= (vla-get-tolerancedisplay
(vlax-ename->vla-object dim_tol_copy_n)
)
1
)
(setq dim_tol_top (rtos (vla-get-toleranceupperlimit
(vlax-ename->vla-object n)
)
2
10
)
dim_tol_min dim_tol_top
)
(progn
(setq dim_tol_top (rtos (vla-get-toleranceupperlimit
(vlax-ename->vla-object n)
)
2
10
)
dim_tol_min (rtos (vla-get-tolerancelowerlimit
(vlax-ename->vla-object n)
)
2
10
)
)
(if (vl-string-search “-” dim_tol_min)
(setq dim_tol_min
(strcat “+”
(vl-string-left-trim “-” dim_tol_min)
)
)
)
)
)
)
)
(list dim_tol_top dim_tol_min)
)
;;;**********************************************************************
(defun dim_tol_dcl (/ dcl_id)
(setq dcl_id (load_dialog dim_tol_dcl_name))
(if (not (new_dialog “dim_tol” dcl_id))
(exit)
)
(if (or (and (= dim_tol_dcl_5 nil) (= dim_tol_dcl_4 nil))
(= dim_tol_dcl_4 “1”)
)
(SET_TILE “dim_tol_dcl_4” “1”)
(progn
(SET_TILE “dim_tol_dcl_5” “1”)
)
)
(dim_tol_dcl1)
(if (= dim_tol_dcl_2 nil)
(setq dim_tol_dcl_2 “0.01”)
)
(if (= dim_tol_dcl_3 nil)
(setq dim_tol_dcl_3 “0.01”)
)
(dim_tol_dcl7)
(dim_tol_dcl2)
(action_tile
“dim_tol_dcl_1”
“(setq dim_tol_dcl_1 $value)(dim_tol_dcl3)”
)
(action_tile
“dim_tol_dcl_2”
“(setq dim_tol_dcl_2 $value)(dim_tol_dcl5)(dim_tol_dcl3)”
)
(action_tile
“dim_tol_dcl_3”
“(setq dim_tol_dcl_3 $value)(dim_tol_dcl6)”
)
(action_tile “dim_tol_dcl_4” “(dim_tol_dcl1)”)
(action_tile “dim_tol_dcl_5” “(dim_tol_dcl1)”)
(action_tile
“dim_tol_dcl_6”
“(setq dim_tol_dcl_code 0)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_7”
“(setq dim_tol_dcl_code 1)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_8”
“(setq dim_tol_dcl_code 2)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_9”
“(setq dim_tol_dcl_code 3)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_10”
“(setq dim_tol_dcl_code 4)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_11”
“(setq dim_tol_dcl_code 5)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_12”
“(setq dim_tol_dcl_code 6)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_13”
“(setq dim_tol_dcl_code 7)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_14”
“(setq dim_tol_dcl_code 8)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_15”
“(setq dim_tol_dcl_code 9)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_16”
“(setq dim_tol_dcl_code 10)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_17”
“(setq dim_tol_dcl_code 11)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_18”
“(setq dim_tol_dcl_code 12)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_19”
“(setq dim_tol_dcl_code 13)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_20”
“(setq dim_tol_dcl_code 14)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_21”
“(setq dim_tol_dcl_code 15)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_22”
“(setq dim_tol_dcl_code 16)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_23”
“(setq dim_tol_dcl_code 17)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_24”
“(setq dim_tol_dcl_code 18)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_25”
“(setq dim_tol_dcl_code 19)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_26”
“(setq dim_tol_dcl_code 20)(dim_tol_dcl4)”
)
(action_tile
“dim_tol_dcl_27”
“(setq dim_tol_dcl_code 27 ok_1 1)(done_dialog)”
)
(action_tile
“dim_tol_dcl_28”
“(setq dim_tol_dcl_code 28 ok_1 1)(done_dialog)”
)
(action_tile
“dim_tol_dcl_29”
“(setq dim_tol_dcl_code 29)(done_dialog)”
)
(setq ok (start_dialog))
(done_dialog)
(unload_dialog dcl_id)
)
;;; ************************
(defun dim_tol_dcl1 (/)
(setq dim_tol_dcl_4 (GET_TILE “dim_tol_dcl_4”)
dim_tol_dcl_5 (GET_TILE “dim_tol_dcl_5”)
)
(if (= dim_tol_dcl_4 “1”)
(progn
(SET_TILE “dim_tol_dcl_4_1”
“***멀티텍스트로 삽입합니다***”
)
(SET_TILE “dim_tol_dcl_5_1” “”)
)
(progn
(SET_TILE “dim_tol_dcl_4_1” “”)
(SET_TILE “dim_tol_dcl_5_1” “***캐드공차로 삽입합니다***”)
)
)
)
;;; ******************************
(defun dim_tol_dcl2 (/)
(if (= dim_tol_dcl_2 dim_tol_dcl_3)
(progn
(SET_TILE “dim_tol_dcl_1” “1”)
(SET_TILE “dim_tol_dcl_2” dim_tol_dcl_2)
(MODE_TILE “dim_tol_dcl_3” 1)
)
(progn
(MODE_TILE “dim_tol_dcl_3” 0)
(SET_TILE “dim_tol_dcl_1” “0”)
(SET_TILE “dim_tol_dcl_2” dim_tol_dcl_2)
(SET_TILE “dim_tol_dcl_3” dim_tol_dcl_3)
)
)
)
;;; ******************************
(defun dim_tol_dcl3 (/)
(if (= dim_tol_dcl_1 “1”)
(progn
(setq dim_tol_dcl_3 dim_tol_dcl_2)
(MODE_TILE “dim_tol_dcl_3” 1)
)
(progn
(MODE_TILE “dim_tol_dcl_3” 0)
(SET_TILE “dim_tol_dcl_3” dim_tol_dcl_3)
)
)
)
;;; ******************************
(defun dim_tol_dcl4 (/)
(done_dialog)
(if (/= (vl-string-search “±” (nth dim_tol_dcl_code dim_tol_data))
nil
)
(setq dim_tol_dcl_2 (vl-string-left-trim
“±”
(nth dim_tol_dcl_code dim_tol_data)
)
dim_tol_dcl_3 dim_tol_dcl_2
)
(setq dim_tol_dcl_2 (substr
(nth dim_tol_dcl_code dim_tol_data)
1
(vl-string-search
“/”
(nth dim_tol_dcl_code dim_tol_data)
)
)
dim_tol_dcl_3 (substr (nth dim_tol_dcl_code dim_tol_data)
(+ (vl-string-search
“/”
(nth dim_tol_dcl_code dim_tol_data)
)
2
)
)
)
)
(dim_tol_dcl7)
(setq ok_1 1)
)
;;; ******************************
(defun dim_tol_dcl5 (/ dim_tol_dcl5_1 dim_tol_dcl5_2)
(setq p 1
dim_tol_dcl5_1
dim_tol_dcl_2
)
(if (wcmatch (substr dim_tol_dcl5_1 1 1) “+,-“)
(setq dim_tol_dcl5_1 (substr dim_tol_dcl5_1 2))
)
(while (<= p (strlen dim_tol_dcl5_1))
(setq dim_tol_dcl5_2 (substr dim_tol_dcl5_1 p 1))
(if (and (/= dim_tol_dcl5_2 “.”)
(= (wcmatch dim_tol_dcl5_2 “#”) nil)
)
(progn
(setq p (+ (strlen dim_tol_dcl5_1) 1))
(MODE_TILE “dim_tol_dcl_2” 2)
)
(setq p (+ p 1))
)
)
)
;;; ******************************
(defun dim_tol_dcl6 (/ dim_tol_dcl6_1 dim_tol_dcl6_2)
(setq p 1
dim_tol_dcl6_1
dim_tol_dcl_3
)
(if (wcmatch (substr dim_tol_dcl6_1 1 1) “+,-“)
(setq dim_tol_dcl6_1 (substr dim_tol_dcl6_1 2))
)
(while (<= p (strlen dim_tol_dcl6_1))
(setq dim_tol_dcl6_2 (substr dim_tol_dcl6_1 p 1))
(if (and (/= dim_tol_dcl6_2 “.”)
(= (wcmatch dim_tol_dcl6_2 “#”) nil)
)
(progn
(setq p (+ (strlen dim_tol_dcl6_1) 1))
(MODE_TILE “dim_tol_dcl_3” 2)
)
(setq p (+ p 1))
)
)
)
;;; ******************************
(defun dim_tol_dcl7 (/)
(if (or (/= (vl-string-search “+” dim_tol_dcl_2) nil)
(= (atof (vl-string-left-trim “+-±” dim_tol_dcl_2)) 0)
)
(setq dim_tol_dcl_2 (vl-string-left-trim “+-±” dim_tol_dcl_2))
)
(if (or (/= (vl-string-search “-” dim_tol_dcl_3) nil)
(= (atof (vl-string-left-trim “+-±” dim_tol_dcl_3)) 0)
)
(setq dim_tol_dcl_3 (vl-string-left-trim “+-±” dim_tol_dcl_3))
)
)
;;;*******************************************************
(defun dim_tol_dcl_made (/
dim_tol_dcl_name_1
dim_tol_dcl_name_2
)
(setq dim_tol_dcl_name (vl-filename-mktemp “dim_tol.dcl”)
dim_tol_dcl_name_1 (open dim_tol_dcl_name “w”)
dim_tol_dcl_name_2 (strcat
“dim_tol : dialog {label=”공차 입력”;
:row{
:boxed_row{label=”입력/선택 공차보기”;
:row{
: toggle {
label = ”±공차”;
key = ”dim_tol_dcl_1”;
width = 8;
height = 1;
}
:column {
:edit_box{
key=”dim_tol_dcl_2”;
edit_width=8;
height = 1;
allow_accept=true;
}
:edit_box{
key=”dim_tol_dcl_3”;
edit_width=8;
height = 1;
allow_accept=true;
}
spacer_1;
}
}
}
:boxed_row{label=”TYPE 선택”;
:radio_column{
: radio_button {
label = ”MTEXT로 삽입”;
key = ”dim_tol_dcl_4”;
width = 15;
height = 1;
}
: radio_button {
label = ”공차로 삽입”;
key = ”dim_tol_dcl_5”;
width = 20;
height = 1;
}
}
:column{
: text {
key = ”dim_tol_dcl_4_1”;
is_bold = true;
width = 30;
height = 1;
alignment = left;
}
: text {
key = ”dim_tol_dcl_5_1”;
is_bold = true;
width = 30;
height = 1;
alignment = left;
}
}
}
}
spacer_1;
:boxed_column{label=”원터치 선택”;
:row{
:button{
label = ”” (nth 0 dim_tol_data)
“”;
key = ”dim_tol_dcl_6”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 1 dim_tol_data)
“”;
key = ”dim_tol_dcl_7”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 2 dim_tol_data)
“”;
key = ”dim_tol_dcl_8”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 3 dim_tol_data)
“”;
key = ”dim_tol_dcl_9”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 4 dim_tol_data)
“”;
key = ”dim_tol_dcl_10”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 5 dim_tol_data)
“”;
key = ”dim_tol_dcl_11”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 6 dim_tol_data)
“”;
key = ”dim_tol_dcl_12”;
height = 2;
width = 13;
}
}
spacer_1;
:row{
:button{
label = ”” (nth 7 dim_tol_data)
“”;
key = ”dim_tol_dcl_13”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 8 dim_tol_data)
“”;
key = ”dim_tol_dcl_14”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 9 dim_tol_data)
“”;
key = ”dim_tol_dcl_15”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 10 dim_tol_data)
“”;
key = ”dim_tol_dcl_16”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 11 dim_tol_data)
“”;
key = ”dim_tol_dcl_17”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 12 dim_tol_data)
“”;
key = ”dim_tol_dcl_18”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 13 dim_tol_data)
“”;
key = ”dim_tol_dcl_19”;
height = 2;
width = 13;
}
}
spacer_1;
:row {
:button{
label = ”” (nth 14 dim_tol_data)
“”;
key = ”dim_tol_dcl_20”;
height = 2;
width = 13;
}” “
:button{
label = ”” (nth 15 dim_tol_data)
“”;
key = ”dim_tol_dcl_21”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 16 dim_tol_data)
“”;
key = ”dim_tol_dcl_22”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 17 dim_tol_data)
“”;
key = ”dim_tol_dcl_23”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 18 dim_tol_data)
“”;
key = ”dim_tol_dcl_24”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 19 dim_tol_data)
“”;
key = ”dim_tol_dcl_25”;
height = 2;
width = 13;
}
:button{
label = ”” (nth 20 dim_tol_data)
“”;
key = ”dim_tol_dcl_26”;
height = 2;
width = 13;
}
}
}
spacer_1;
:row{
spacer_1;
:button{
label = ”삭제”;
key = ”dim_tol_dcl_27”;
height = 2;
width = 13;
}
:button{
label = ”복사”;
key = ”dim_tol_dcl_28”;
height = 2;
width = 13;
}
: spacer {width = 55; height = 1;}
:button{
label = ”설정”;
key = ”dim_tol_dcl_29”;
height = 2;
width = 13;
}
spacer_1;
}
: spacer {width = 1; height = 2;}
ok_cancel;
}
“ )
)
(write-line dim_tol_dcl_name_2 dim_tol_dcl_name_1)
(close dim_tol_dcl_name_1)
)
;;;**********************************************
(defun dim_tol_data_setting (/ dim_tol_setting_1
dim_tol_setting_2 dim_tol_setting_3
dim_tol_setting_4 p
)
(setq dim_tol_data nil)
(if (/= (open (setq dim_tol_setting_1 “c://dim_tol.dat”) “r”)
nil
)
(progn
(setq dim_tol_setting_2
(open dim_tol_setting_1 “r”)
dim_tol_setting_3
(read-line dim_tol_setting_2)
dim_tol_setting_3
(read-line dim_tol_setting_2)
p 0
)
(while (and (< p 27) (/= dim_tol_setting_3 nil))
(setq dim_tol_data
(append dim_tol_data (list dim_tol_setting_3))
dim_tol_setting_3
(read-line dim_tol_setting_2)
p (+ p 1)
)
)
(close dim_tol_setting_2)
(if (/= (LENGTH dim_tol_data) 27)
(progn
(setq dim_tol_data nil)
(dim_tol_data_setting_1)
)
)
)
(progn
(dim_tol_data_setting_1)
)
)
)
;;;**************************************************
(defun dim_tol_data_setting_1 (/ dim_tol_setting_1 dim_tol_setting_2 p)
(if (= dim_tol_data nil)
(setq dim_tol_data
(list “0.002/0” “0.005/0” “0.01/0” “0.02/0”
“0.05/0” “0.1/0” “0.2/0” “±0.002”
“±0.005” “±0.01” “±0.02” “±0.05”
“±0.1” “±0.2” “0/0.002” “0/0.005”
“0/0.01” “0/0.02” “0/0.05” “0/0.1”
“0/0.2” “0.55” “0.8” “0”
“0.8” “0” “0/3”
)
)
)
(setq dim_tol_setting_1 “c://dim_tol.dat”
dim_tol_setting_2 (open dim_tol_setting_1 “w”)
)
(write-line
“치수공차리습에 적용할 환경데이타 입니다,수정하지 마세요 “
dim_tol_setting_2
)
(setq p 0)
(while (< p (LENGTH dim_tol_data))
(write-line (nth p dim_tol_data) dim_tol_setting_2)
(setq p (+ p 1))
)
(close dim_tol_setting_2)
)
;;;*************************************************
(defun dim_tol_data_setting_dcl (/ dcl_id_1 p)
(setq dcl_id_1 (load_dialog dim_tol_setting_dcl_name))
(if (not (new_dialog “dim_tol_setting” dcl_id_1))
(exit)
)
(setq p 1
dim_tol_data_setting_ok
0
)
(REPEAT 21
(setq dim_tol_setting_dcl_1 (nth (- p 1) dim_tol_data))
(if (/= (vl-string-search “±” dim_tol_setting_dcl_1) NIL)
(SET_TILE (strcat “dim_tol_setting_” (rtos p) “_1”)
(vl-string-left-trim “±” dim_tol_setting_dcl_1)
)
(SET_TILE (strcat “dim_tol_setting_” (rtos p) “_1”)
(vl-string-left-trim
“+”
(substr dim_tol_setting_dcl_1
1
(vl-string-search “/” dim_tol_setting_dcl_1)
)
)
)
)
(setq p (+ p 1))
)
(setq p 1)
(REPEAT 21
(setq dim_tol_setting_dcl_1 (nth (- p 1) dim_tol_data))
(if (/= (vl-string-search “±” dim_tol_setting_dcl_1) NIL)
(SET_TILE (strcat “dim_tol_setting_” (rtos p) “_2”)
(vl-string-left-trim “±” dim_tol_setting_dcl_1)
)
(SET_TILE
(strcat “dim_tol_setting_” (rtos p) “_2”)
(vl-string-left-trim
“-“
(substr dim_tol_setting_dcl_1
(+ 2 (vl-string-search “/” dim_tol_setting_dcl_1))
)
)
)
)
(setq p (+ p 1))
)
;;; (setq p 22)
(REPEAT 5
(setq dim_tol_setting_dcl_1 (nth (- p 1) dim_tol_data))
(SET_TILE (strcat “dim_tol_setting_” (rtos p))
(nth (- p 1) dim_tol_data)
)
(setq p (+ p 1))
)
(setq dim_tol_setting_27 (substr (nth 26 dim_tol_data) 1 1)
dim_tol_setting_28 (atoi (substr (nth 26 dim_tol_data)
(+ 2
(vl-string-search
“/”
(nth 26 dim_tol_data)
)
)
)
)
)
(dim_tol_setting_color)
(dim_tol_data_setting_dcl1)
(action_tile
“dim_tol_setting_1_1”
“(setq dim_tol_setting_1_1 $VALUE dim_tol_setting_code 1)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_1_2”
“(setq dim_tol_setting_1_2 $VALUE dim_tol_setting_code 1)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_2_1”
“(setq dim_tol_setting_2_1 $VALUE dim_tol_setting_code 2)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_2_2”
“(setq dim_tol_setting_2_2 $VALUE dim_tol_setting_code 2)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_3_1”
“(setq dim_tol_setting_3_1 $VALUE dim_tol_setting_code 3)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_3_2”
“(setq dim_tol_setting_3_2 $VALUE dim_tol_setting_code 3)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_4_1”
“(setq dim_tol_setting_4_1 $VALUE dim_tol_setting_code 4)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_4_2”
“(setq dim_tol_setting_4_2 $VALUE dim_tol_setting_code 4)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_5_1”
“(setq dim_tol_setting_5_1 $VALUE dim_tol_setting_code 5)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_5_2”
“(setq dim_tol_setting_5_2 $VALUE dim_tol_setting_code 5)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_6_1”
“(setq dim_tol_setting_6_1 $VALUE dim_tol_setting_code 6)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_6_2”
“(setq dim_tol_setting_6_2 $VALUE dim_tol_setting_code 6)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_7_1”
“(setq dim_tol_setting_7_1 $VALUE dim_tol_setting_code 7)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_7_2”
“(setq dim_tol_setting_7_2 $VALUE dim_tol_setting_code 7)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_8_1”
“(setq dim_tol_setting_8_1 $VALUE dim_tol_setting_code 8)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_8_2”
“(setq dim_tol_setting_8_2 $VALUE dim_tol_setting_code 8)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_9_1”
“(setq dim_tol_setting_9_1 $VALUE dim_tol_setting_code 9)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_9_2”
“(setq dim_tol_setting_9_2 $VALUE dim_tol_setting_code 9)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_10_1”
“(setq dim_tol_setting_10_1 $VALUE dim_tol_setting_code 10)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_10_2”
“(setq dim_tol_setting_10_2 $VALUE dim_tol_setting_code 10)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_11_1”
“(setq dim_tol_setting_11_1 $VALUE dim_tol_setting_code 11)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_11_2”
“(setq dim_tol_setting_11_2 $VALUE dim_tol_setting_code 11)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_12_1”
“(setq dim_tol_setting_12_1 $VALUE dim_tol_setting_code 12)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_12_2”
“(setq dim_tol_setting_12_2 $VALUE dim_tol_setting_code 12)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_13_1”
“(setq dim_tol_setting_13_1 $VALUE dim_tol_setting_code 13)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_13_2”
“(setq dim_tol_setting_13_2 $VALUE dim_tol_setting_code 13)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_14_1”
“(setq dim_tol_setting_14_1 $VALUE dim_tol_setting_code 14)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_14_2”
“(setq dim_tol_setting_14_2 $VALUE dim_tol_setting_code 14)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_15_1”
“(setq dim_tol_setting_15_1 $VALUE dim_tol_setting_code 15)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_15_2”
“(setq dim_tol_setting_15_2 $VALUE dim_tol_setting_code 15)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_16_1”
“(setq dim_tol_setting_16_1 $VALUE dim_tol_setting_code 16)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_16_2”
“(setq dim_tol_setting_16_2 $VALUE dim_tol_setting_code 16)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_17_1”
“(setq dim_tol_setting_17_1 $VALUE dim_tol_setting_code 17)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_17_2”
“(setq dim_tol_setting_17_2 $VALUE dim_tol_setting_code 17)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_18_1”
“(setq dim_tol_setting_18_1 $VALUE dim_tol_setting_code 18)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_18_2”
“(setq dim_tol_setting_18_2 $VALUE dim_tol_setting_code 18)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_19_1”
“(setq dim_tol_setting_19_1 $VALUE dim_tol_setting_code 19)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_19_2”
“(setq dim_tol_setting_19_2 $VALUE dim_tol_setting_code 19)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_20_1”
“(setq dim_tol_setting_20_1 $VALUE dim_tol_setting_code 20)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_20_2”
“(setq dim_tol_setting_20_2 $VALUE dim_tol_setting_code 20)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_21_1”
“(setq dim_tol_setting_21_1 $VALUE dim_tol_setting_code 21)(dim_tol_data_setting_dcl3)”
)
(action_tile
“dim_tol_setting_21_2”
“(setq dim_tol_setting_21_2 $VALUE dim_tol_setting_code 21)(dim_tol_data_setting_dcl4)”
)
(action_tile
“dim_tol_setting_22”
“(setq dim_tol_setting_22 $VALUE dim_tol_setting_code 22)(dim_tol_data_setting_dcl5)”
)
(action_tile
“dim_tol_setting_23”
“(setq dim_tol_setting_23 $VALUE dim_tol_setting_code 23)(dim_tol_data_setting_dcl5)”
)
(action_tile
“dim_tol_setting_24”
“(setq dim_tol_setting_24 $VALUE dim_tol_setting_code 24)(dim_tol_data_setting_dcl6)”
)
(action_tile
“dim_tol_setting_25”
“(setq dim_tol_setting_25 $VALUE dim_tol_setting_code 25)(dim_tol_data_setting_dcl5)”
)
(action_tile
“dim_tol_setting_26”
“(setq dim_tol_setting_26 $VALUE)”
)
(action_tile
“dim_tol_setting_27”
“(setq dim_tol_setting_27 $VALUE)(dim_tol_setting_color)”
)
(action_tile
“dim_tol_setting_28”
“(dim_tol_setting_color1)”
)
(setq dim_tol_data_setting_ok (start_dialog))
(done_dialog)
(unload_dialog dcl_id_1)
)
;;;*************************************************
(defun dim_tol_data_setting_dcl1 (/)
(setq dim_tol_setting_1_1
(GET_TILE “dim_tol_setting_1_1”)
dim_tol_setting_1_2
(GET_TILE “dim_tol_setting_1_2”)
dim_tol_setting_2_1
(GET_TILE “dim_tol_setting_2_1”)
dim_tol_setting_2_2
(GET_TILE “dim_tol_setting_2_2”)
dim_tol_setting_3_1
(GET_TILE “dim_tol_setting_3_1”)
dim_tol_setting_3_2
(GET_TILE “dim_tol_setting_3_2”)
dim_tol_setting_4_1
(GET_TILE “dim_tol_setting_4_1”)
dim_tol_setting_4_2
(GET_TILE “dim_tol_setting_4_2”)
dim_tol_setting_5_1
(GET_TILE “dim_tol_setting_5_1”)
dim_tol_setting_5_2
(GET_TILE “dim_tol_setting_5_2”)
dim_tol_setting_6_1
(GET_TILE “dim_tol_setting_6_1”)
dim_tol_setting_6_2
(GET_TILE “dim_tol_setting_6_2”)
dim_tol_setting_7_1
(GET_TILE “dim_tol_setting_7_1”)
dim_tol_setting_7_2
(GET_TILE “dim_tol_setting_7_2”)
dim_tol_setting_8_1
(GET_TILE “dim_tol_setting_8_1”)
dim_tol_setting_8_2
(GET_TILE “dim_tol_setting_8_2”)
dim_tol_setting_9_1
(GET_TILE “dim_tol_setting_9_1”)
dim_tol_setting_9_2
(GET_TILE “dim_tol_setting_9_2”)
dim_tol_setting_10_1
(GET_TILE “dim_tol_setting_10_1”)
dim_tol_setting_10_2
(GET_TILE “dim_tol_setting_10_2”)
dim_tol_setting_11_1
(GET_TILE “dim_tol_setting_11_1”)
dim_tol_setting_11_2
(GET_TILE “dim_tol_setting_11_2”)
dim_tol_setting_12_1
(GET_TILE “dim_tol_setting_12_1”)
dim_tol_setting_12_2
(GET_TILE “dim_tol_setting_12_2”)
dim_tol_setting_13_1
(GET_TILE “dim_tol_setting_13_1”)
dim_tol_setting_13_2
(GET_TILE “dim_tol_setting_13_2”)
dim_tol_setting_14_1
(GET_TILE “dim_tol_setting_14_1”)
dim_tol_setting_14_2
(GET_TILE “dim_tol_setting_14_2”)
dim_tol_setting_15_1
(GET_TILE “dim_tol_setting_15_1”)
dim_tol_setting_15_2
(GET_TILE “dim_tol_setting_15_2”)
dim_tol_setting_16_1
(GET_TILE “dim_tol_setting_16_1”)
dim_tol_setting_16_2
(GET_TILE “dim_tol_setting_16_2”)
dim_tol_setting_17_1
(GET_TILE “dim_tol_setting_17_1”)
dim_tol_setting_17_2
(GET_TILE “dim_tol_setting_17_2”)
dim_tol_setting_18_1
(GET_TILE “dim_tol_setting_18_1”)
dim_tol_setting_18_2
(GET_TILE “dim_tol_setting_18_2”)
dim_tol_setting_19_1
(GET_TILE “dim_tol_setting_19_1”)
dim_tol_setting_19_2
(GET_TILE “dim_tol_setting_19_2”)
dim_tol_setting_20_1
(GET_TILE “dim_tol_setting_20_1”)
dim_tol_setting_20_2
(GET_TILE “dim_tol_setting_20_2”)
dim_tol_setting_21_1
(GET_TILE “dim_tol_setting_21_1”)
dim_tol_setting_21_2
(GET_TILE “dim_tol_setting_21_2”)
dim_tol_setting_22
(GET_TILE “dim_tol_setting_22”)
dim_tol_setting_23
(GET_TILE “dim_tol_setting_23”)
dim_tol_setting_24
(GET_TILE “dim_tol_setting_24”)
dim_tol_setting_25
(GET_TILE “dim_tol_setting_25”)
dim_tol_setting_26
(GET_TILE “dim_tol_setting_26”)
)
)
;;;*************************************************
(defun dim_tol_data_setting_dcl2 (/)
(setq dim_tol_data nil)
(if (= (vl-string-left-trim “+” dim_tol_setting_1_1)
(vl-string-left-trim “-” dim_tol_setting_1_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_1_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_1_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_1_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_2_1)
(vl-string-left-trim “-” dim_tol_setting_2_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_2_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_2_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_2_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_3_1)
(vl-string-left-trim “-” dim_tol_setting_3_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_3_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_3_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_3_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_4_1)
(vl-string-left-trim “-” dim_tol_setting_4_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_4_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_4_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_4_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_5_1)
(vl-string-left-trim “-” dim_tol_setting_5_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_5_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_5_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_5_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_6_1)
(vl-string-left-trim “-” dim_tol_setting_6_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_6_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_6_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_6_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_7_1)
(vl-string-left-trim “-” dim_tol_setting_7_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_7_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_7_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_7_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_8_1)
(vl-string-left-trim “-” dim_tol_setting_8_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_8_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_8_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_8_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_9_1)
(vl-string-left-trim “-” dim_tol_setting_9_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_9_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_9_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_9_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_10_1)
(vl-string-left-trim “-” dim_tol_setting_10_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_10_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_10_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_10_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_11_1)
(vl-string-left-trim “-” dim_tol_setting_11_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_11_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_11_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_11_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_12_1)
(vl-string-left-trim “-” dim_tol_setting_12_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_12_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_12_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_12_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_13_1)
(vl-string-left-trim “-” dim_tol_setting_13_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_13_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_13_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_13_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_14_1)
(vl-string-left-trim “-” dim_tol_setting_14_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_14_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_14_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_14_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_15_1)
(vl-string-left-trim “-” dim_tol_setting_15_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_15_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_15_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_15_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_16_1)
(vl-string-left-trim “-” dim_tol_setting_16_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_16_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_16_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_16_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_17_1)
(vl-string-left-trim “-” dim_tol_setting_17_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_17_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_17_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_17_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_18_1)
(vl-string-left-trim “-” dim_tol_setting_18_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_18_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_18_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_18_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_19_1)
(vl-string-left-trim “-” dim_tol_setting_19_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_19_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_19_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_19_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_20_1)
(vl-string-left-trim “-” dim_tol_setting_20_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_20_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_20_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_20_2)
)
)
)
)
)
(if (= (vl-string-left-trim “+” dim_tol_setting_21_1)
(vl-string-left-trim “-” dim_tol_setting_21_2)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
“±”
(vl-string-left-trim “+” dim_tol_setting_21_1)
)
)
)
)
(setq dim_tol_data
(append
dim_tol_data
(list
(strcat
(vl-string-left-trim “+” dim_tol_setting_21_1)
“/”
(vl-string-left-trim “-” dim_tol_setting_21_2)
)
)
)
)
)
(setq dim_tol_data
(append dim_tol_data
(list dim_tol_setting_22
dim_tol_setting_23
dim_tol_setting_24
dim_tol_setting_25
dim_tol_setting_26
(strcat dim_tol_setting_27
“/”
(rtos dim_tol_setting_28)
)
)
)
)
)
;;;*************************************************
(defun dim_tol_data_setting_dcl3 (/
p
dim_tol_data_text
dim_tol_data_text_1
dim_tol_data_text_2
)
(setq dim_tol_data_text
(GET_TILE
(strcat “dim_tol_setting_”
(rtos dim_tol_setting_code)
“_1”
)
)
)
(if (/= (wcmatch (substr dim_tol_data_text 1 1) “+,-“) nil)
(setq dim_tol_data_text_1 (substr dim_tol_data_text 2))
(setq dim_tol_data_text_1 dim_tol_data_text)
)
(setq p 1)
(while (<= p (strlen dim_tol_data_text_1))
(setq dim_tol_data_text_2
(substr dim_tol_data_text_1 p 1)
p (+ p 1)
)
(if (and (= (wcmatch dim_tol_data_text_2 “#”) nil)
(/= dim_tol_data_text_2 “.”)
)
(setq p (+ 2 (strlen dim_tol_data_text_1)))
)
)
(if (= p (+ 2 (strlen dim_tol_data_text_1)))
(progn
(alert “입력오류!정확하게 입력하세요”)
(MODE_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code) “_1”)
2
)
)
(progn
(if (= (atof (vl-string-left-trim “+-” dim_tol_data_text)) 0)
(SET_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code) “_1”)
“0”
)
(SET_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code) “_1”)
dim_tol_data_text
)
)
)
)
)
;;;*************************************************
(defun dim_tol_data_setting_dcl4
(/
p
dim_tol_data_text
dim_tol_data_text_1
dim_tol_data_text_2
)
(setq dim_tol_data_text
(GET_TILE (strcat “dim_tol_setting_”
(rtos dim_tol_setting_code)
“_2”
)
)
)
(if (/= (wcmatch (substr dim_tol_data_text 1 1) “+,-“) nil)
(setq dim_tol_data_text_1 (substr dim_tol_data_text 2))
(setq dim_tol_data_text_1 dim_tol_data_text)
)
(setq p 1)
(while (<= p (strlen dim_tol_data_text_1))
(setq dim_tol_data_text_2
(substr dim_tol_data_text_1 p 1)
p (+ p 1)
)
(if (and (= (wcmatch dim_tol_data_text_2 “#”) nil)
(/= dim_tol_data_text_2 “.”)
)
(setq p (+ 2 (strlen dim_tol_data_text_1)))
)
)
(if (= p (+ 2 (strlen dim_tol_data_text_1)))
(progn
(alert “입력오류!정확하게 입력하세요”)
(MODE_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code) “_2”)
2
)
)
(progn
(if (= (atof (vl-string-left-trim “+-” dim_tol_data_text)) 0)
(SET_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code) “_2”)
“0”
)
(SET_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code) “_2”)
dim_tol_data_text
)
)
)
)
)
;;;*************************************************
(defun dim_tol_data_setting_dcl5
(/ p dim_tol_data_text dim_tol_data_text_1)
(setq dim_tol_data_text
(GET_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code))
)
)
(setq p 1)
(while (<= p (strlen dim_tol_data_text))
(setq dim_tol_data_text_1
(substr dim_tol_data_text p 1)
p (+ p 1)
)
(if (and (= (wcmatch dim_tol_data_text_1 “#”) nil)
(/= dim_tol_data_text_1 “.”)
)
(setq p (+ 2 (strlen dim_tol_data_text)))
)
)
(if (= p (+ 2 (strlen dim_tol_data_text)))
(progn
(alert “입력오류!숫자만 입력하세요”)
(MODE_TILE (strcat “dim_tol_setting_” (rtos dim_tol_setting_code))
2
)
)
(progn
(if (> (atof dim_tol_data_text) 1)
(progn
(alert “입력오류! 1 이하로 입력하세요”)
(MODE_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code))
2
)
)
(progn
(SET_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code))
dim_tol_data_text
)
)
)
)
)
)
;;;*************************************************
(defun dim_tol_data_setting_dcl6
(/ p dim_tol_data_text dim_tol_data_text_1)
(setq dim_tol_data_text
(GET_TILE
(strcat “dim_tol_setting_” (rtos dim_tol_setting_code))
)
)
(setq p 1)
(while (<= p (strlen dim_tol_data_text))
(setq dim_tol_data_text_1
(substr dim_tol_data_text p 1)
p (+ p 1)
)
(if (= (wcmatch dim_tol_data_text_1 “#”) nil)
(setq p (+ 2 (strlen dim_tol_data_text)))
)
)
(if (= p (+ 2 (strlen dim_tol_data_text)))
(progn
(alert “입력오류!정수만 입력하세요”)
(MODE_TILE (strcat “dim_tol_setting_” (rtos dim_tol_setting_code))
2
)
)
(progn
(SET_TILE (strcat “dim_tol_setting_” (rtos dim_tol_setting_code))
dim_tol_data_text
)
)
)
)
;;;*************************************************
(defun dim_tol_setting_color (/)
(if (= dim_tol_setting_27 “1”)
(progn
(SET_TILE “dim_tol_setting_27” “1”)
(MODE_TILE “dim_tol_setting_28” 0)
(MODE_TILE “dim_tol_setting_29” 0)
(SET_TILE “dim_tol_setting_29” “DTEXT타입에서만 적용”)
(start_image “dim_tol_setting_28”)
(setq x (dimx_tile “dim_tol_setting_28”)
y (dimy_tile “dim_tol_setting_28”)
)
(fill_image 0 0 x y dim_tol_setting_28)
(end_image)
)
(progn
(SET_TILE “dim_tol_setting_27” “0”)
(SET_TILE “dim_tol_setting_29” “”)
(MODE_TILE “dim_tol_setting_28” 0)
(MODE_TILE “dim_tol_setting_29” 1)
(start_image “dim_tol_setting_28”)
(setq x (dimx_tile “dim_tol_setting_28”)
y (dimy_tile “dim_tol_setting_28”)
)
(fill_image 0 0 x y -15)
(end_image)
(MODE_TILE “dim_tol_setting_28” 1)
)
)
)
;;;*************************************************
(defun dim_tol_setting_color1 (/ dim_tol_setting_28_1)
(setq dim_tol_setting_28_1 dim_tol_setting_28)
(if (= (SETQ dim_tol_setting_28 (acad_colordlg dim_tol_setting_28))
nil
)
(setq dim_tol_setting_28 dim_tol_setting_28_1)
)
(dim_tol_setting_color)
)
;;; **************
(defun dim_tol_data_setting_dcl_made
(/ dim_tol_setting_dcl_name_1 dim_tol_setting_dcl_name_2)
(setq dim_tol_setting_dcl_name
(vl-filename-mktemp “dim_tol_setting.dcl”)
dim_tol_setting_dcl_name_1
(open dim_tol_setting_dcl_name “w”)
dim_tol_setting_dcl_name_2
(strcat
“dim_tol_setting : dialog {label=”기본공차 및 환경설정”;
:boxed_row{
:column {
:edit_box{label=”상”;
key=”dim_tol_setting_1_1”;
edit_width=5;
height = 1;
}
:edit_box{label=”하”;
key=”dim_tol_setting_1_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_2_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_2_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_3_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_3_2”;
edit_width=5;
height = 1;
}
}” “
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_4_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_4_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_5_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_5_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_6_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_6_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_7_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_7_2”;
edit_width=5;
height = 1;
}
}
}
:boxed_row{
:column {
:edit_box{label=”상”;
key=”dim_tol_setting_8_1”;
edit_width=5;
height = 1;
}
:edit_box{label=”하”;
key=”dim_tol_setting_8_2”;
edit_width=5;
height = 1;
}
}” “
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_9_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_9_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_10_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_10_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_11_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_11_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_12_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_12_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_13_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_13_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_14_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_14_2”;
edit_width=5;
height = 1;
}
}
}
:boxed_row{
:column {
:edit_box{label=”상”;
key=”dim_tol_setting_15_1”;
edit_width=5;
height = 1;
}
:edit_box{label=”하”;
key=”dim_tol_setting_15_2”;
edit_width=5;
height = 1;
}
}” “
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_16_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_16_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_17_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_17_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_18_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_18_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_19_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_19_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_20_1”;
edit_width=5;
height = 1;
}
:edit_box{
key=”dim_tol_setting_20_2”;
edit_width=5;
height = 1;
}
}
spacer_1;
:column {
:edit_box{
key=”dim_tol_setting_21_1”;
edit_width=5;
height = 1;
}” “
:edit_box{
key=”dim_tol_setting_21_2”;
edit_width=5;
height = 1;
}
}
}
:spacer {width=5; height = 1.5;}
:row{
:boxed_column {
:edit_box{label=”상하공차 문자비율(1이하)”;
key=”dim_tol_setting_22”;
edit_width=5;
height = 1;
}
:edit_box{label=”±공차 문자비율(1이하)”;
key=”dim_tol_setting_23”;
edit_width=5;
height = 1;
}
:edit_box{label=”치수와공차간 간격”;
key=”dim_tol_setting_24”;
edit_width=5;
height = 1;
}
:edit_box{label=”공차문자 장평비율(1이하)”;
key=”dim_tol_setting_25”;
edit_width=5;
height = 1;
}
}
:spacer {width=5; height = 1;}
:boxed_column {
:spacer {width=1; height = 1;}
: toggle {
label = ”공차0에 + -표시하기”;
key = ”dim_tol_setting_26”;
}
:spacer {width=1; height = 1;}
:row {
: toggle {
label = ”공차에 색상적용”;
key = ”dim_tol_setting_27”;
}
: image_button {
key = ”dim_tol_setting_28”;
color = -15;
width = 5;
height = 2;
}
}
: text {label = ”DTEXT타입에서만 적용”;
key = ”dim_tol_setting_29”;
is_bold = true;
width = 30;
height = 1;
alignment = centered;
}
}
}
spacer_1;
ok_cancel;
}
“)
)
(write-line
dim_tol_setting_dcl_name_2
dim_tol_setting_dcl_name_1
)
(close dim_tol_setting_dcl_name_1)
(dim_tol_data_setting_dcl)
(vl-file-delete dim_tol_setting_dcl_name)
(if (= dim_tol_data_setting_ok 1)
(progn
(dim_tol_data_setting_dcl2)
(dim_tol_data_setting_1)
)
)
)
(princ)
1 답변