아이소 치수 리습 수정 부탁합니다
컨텐츠 정보
- 278 조회
- 0 추천
- 0 비추천
- 목록
본문
치수선과 보조선,문자색상을 바꾸고 싶은데 부탁 드립니다
;=================================================
(defun dtr (a)
(* pi (/ a 180.0))
)
(defun rtd (a)
(/ (* a 180.0) pi)
)
(defun c:dm(/ pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 pt9 pt10 ang t_ang g_ang l_dist t_dist str)
(setq txt-h 2.0)
(setq s (getvar "dimscale"))
(setq text-type 2)
(setq orth(getvar "orthomode"))
(setq os(getvar "osmode"))
(setvar "osmode" 33)
(setq sk1 (* 1.0 s))
(setq cor_sty (getvar "textstyle"))
(setq pt1 (getpoint "nPick iso dimension start point : ")
pt2 (getpoint "nPick iso dimension end point : " pt1)
pt3 (getpoint "nPick iso dimension line position : " pt2)
ang (angle pt1 pt2) ; dimension line angle
t_ang (angle pt2 pt3) ; text style angle
g_ang (angtos ang) ; function angle
l_dist (distance pt1 pt2) ; dimension line distance
t_dist (* 15 sk1) ; dimension line distance
pt3 (polar pt1 t_ang t_dist)
pt4 (polar pt2 t_ang t_dist)
pt5 (polar pt3 ang (/ (distance pt1 pt2) 2))
pt7 (polar pt3 t_ang (* 1.4 sk1))
pt8 (polar pt4 t_ang (* 1.4 sk1))
pt9 (polar pt1 t_ang (* 1.4 sk1))
pt10(polar pt2 t_ang (* 1.4 sk1))
str (getstring "nInput text string : ")
)
(if (or (and (>= (rtd ang) 61) (<= (rtd ang) 120))
(and (>= (rtd ang) 241) (<= (rtd ang) 300))
)
(setq pt6 (polar pt5 (dtr 210) (* 1.4 sk1)))
(setq pt6 (polar pt5 (dtr 90) (* 1.4 sk1)))
)
(setvar "osmode" 0)
(command "line" pt9 pt7 "")
(command "line" pt3 pt4 "")
(command "line" pt10 pt8 "")
(daa pt3 ang)
(daa pt4 (+ ang (dtr 180)))
(i_t pt6 ang str)
(setq q_con (strcase (getstring "nDo you want to continue dimension < Yes / No > : ")))
(if (= q_con "N")(setq jhg nil)(setq jhg 7))
(while jhg
(setvar "osmode" 33)
(setq pt1 pt2)
(setq pt2 (getpoint "nPick iso dimension end point : " pt1))
(if (= pt2 nil)
(setq jhg nil)
(progn
(setq pt3 (getpoint "nPick iso dimension line position : " pt2)
ang (angle pt1 pt2) ; dimension line angle
t_ang (angle pt2 pt3) ; text style angle
g_ang (angtos ang) ; function angle
l_dist (distance pt1 pt2) ; dimension line distance
t_dist (* 15 sk1) ; dimension line distance
pt3 (polar pt1 t_ang t_dist)
pt4 (polar pt2 t_ang t_dist)
pt5 (polar pt3 ang (/ (distance pt1 pt2) 2))
pt7 (polar pt3 t_ang (* 1.4 sk1))
pt8 (polar pt4 t_ang (* 1.4 sk1))
pt9 (polar pt1 t_ang (* 1.4 sk1))
pt10(polar pt2 t_ang (* 1.4 sk1))
str (getstring "nInput text string : ")
)
(if (or (and (>= (rtd ang) 61) (<= (rtd ang) 120))
(and (>= (rtd ang) 241) (<= (rtd ang) 300))
)
(setq pt6 (polar pt5 (dtr 210) (* 1.4 sk1)))
(setq pt6 (polar pt5 (dtr 90) (* 1.4 sk1)))
)
(setvar "osmode" 0)
(command "line" pt9 pt7 "")
(command "line" pt3 pt4 "")
(command "line" pt10 pt8 "")
(daa pt3 ang)
(daa pt4 (+ ang (dtr 180)))
(i_t pt6 ang str)
)
)
)
(setvar "textstyle" cor_sty)
(setvar "orthomode" orth)
(setvar "osmode" os)
(prin1)
)
;=================================================
(defun i_t(g_pt g_ang g_str)
(if (= text-type 2)
(progn
(if (not (tblsearch "style" "D1″))
(progn
(command "filedia" "0″)
(command "style" "D1″ "ROMANS" "" "0.8″ "30″ "" "" "")
(command "filedia" "1″)
)
)
(if (not (tblsearch "style" "D2″))
(progn
(command "filedia" "0″)
(command "style" "D2″ "ROMANS" "" "0.8″ "-30″ "" "" "")
(command "filedia" "1″)
)
)
)
)
(cond
((and (>= (rtd g_ang) 15) (<= (rtd g_ang) 60))
(if (= text-type 2)
(if (or (and (>= (rtd t_ang) 61) (<= (rtd t_ang) 120)) (and (>= (rtd t_ang) 241) (<= (rtd t_ang) 300)))
(setvar "textstyle" "D1″)
(setvar "textstyle" "D2″)
)
(setvar "textstyle" "ROMANS")
)
(command "text" "c" g_pt (* txt-h s) "30″ g_str)
)
((and (>= (rtd g_ang) 61) (<= (rtd g_ang) 120))
(if (= text-type 2)
(if (or (and (>= (rtd t_ang) 15) (<= (rtd t_ang) 60)) (and (>= (rtd t_ang) 181) (<= (rtd t_ang) 240)))
(setvar "textstyle" "D2″)
(setvar "textstyle" "D1″)
)
(setvar "textstyle" "ROMANS")
)
(command "text" "c" g_pt (* txt-h s) "90″ g_str)
)
((and (>= (rtd g_ang) 121) (<= (rtd g_ang) 180))
(if (= text-type 2)
(if (or (and (>= (rtd t_ang) 15) (<= (rtd t_ang) 60)) (and (>= (rtd t_ang) 181) (<= (rtd t_ang) 240)))
(setvar "textstyle" "D1″)
(setvar "textstyle" "D2″)
)
(setvar "textstyle" "ROMANS")
)
(command "text" "c" g_pt (* txt-h s) "330″ g_str)
)
((and (>= (rtd g_ang) 181) (<= (rtd g_ang) 240))
(if (= text-type 2)
(if (or (and (>= (rtd t_ang) 61) (<= (rtd t_ang) 120)) (and (>= (rtd t_ang) 241) (<= (rtd t_ang) 300)))
(setvar "textstyle" "D1″)
(setvar "textstyle" "D2″)
)
(setvar "textstyle" "ROMANS")
)
(command "text" "c" g_pt (* txt-h s) "30″ g_str)
)
((and (>= (rtd g_ang) 241) (<= (rtd g_ang) 300))
(if (= text-type 2)
(if (or (and (>= (rtd t_ang) 15) (<= (rtd t_ang) 60)) (and (>= (rtd t_ang) 181) (<= (rtd t_ang) 240)))
(setvar "textstyle" "D2″)
(setvar "textstyle" "D1″)
)
(setvar "textstyle" "ROMANS")
)
(command "text" "c" g_pt (* txt-h s) "90″ g_str)
)
((and (>= (rtd g_ang) 301) (<= (rtd g_ang) 360))
(if (= text-type 2)
(if (or (and (>= (rtd t_ang) 61) (<= (rtd t_ang) 120)) (and (>= (rtd t_ang) 241) (<= (rtd t_ang) 300)))
(setvar "textstyle" "D2″)
(setvar "textstyle" "D1″)
)
(setvar "textstyle" "ROMANS")
)
(command "text" "c" g_pt (* txt-h s) "330″ g_str)
)
)
(princ)
)
(defun daa (g_pt g_ang / pt3 pt4)
(setq as (* 0.4 s);;arrow hight
pt21 (polar g_pt g_ang (* 2.5 s));;arrow length
g_ang (angtos g_ang)
)
(setq pt3 (polar pt21 t_ang as)
pt4 (polar pt21 (+ t_ang (dtr 180)) as)
)
(command "solid" g_pt pt4 pt3 "" "")
(princ)
)