(defun c:p1 ()
(graphscr)
(reset)
(prompt “*** PART NO. (SINGLE) ***”)(princ)
(setq siz (getvar “dimscale”))
(setq t 1)
(setq gap (* siz 12)) ;circle diameter
(setvar “cmdecho” 0)
(setvar “osmode” 0)
(setvar “orthomode” 0)
(setq cla (getvar “clayer”))
(setq tsz (* siz 3.75))
(setq sty (getvar “textstyle”))
(setq dn1 (* siz 0.01))
(setq dn2 (* siz 1.5))
(command “layer” “s” “4” “”)
(command “osnap” “off”)
(setq pnt1 (getpoint “nSelect part :”))
(setq pnt2 (getpoint “nTo point :” pnt1))
(command “donut” dn1 dn2 pnt1 “”)
(command “line” pnt1 pnt2)
(while t
(setq pnt3 pnt2)
(setq pnt2 (getpoint “nTo point :” pnt2))
(command pnt2)
(setq e2 (entlast))
(if (= pnt2 nil)
(setq t nil)
)
)
(command “layer” “s” “1” “”)
(command “circle” pnt3 “d” gap) (setq e3 (entlast))
(command “trim” e3 “” (list e2 pnt3) “”)
(command “layer” “s” “8” “”)
(if (= num nil) (setq num “”))
(setq re_num num)
(setq num (strcase (getstring (strcat “nEnter part number <" (strcat num) "> :”))))
(if (= num nil) (setq num re_num))
(setvar “textstyle” “romans”)
(command “text” “j” “m” pnt3 tsz “0” num)
(setvar “textstyle” sty)
(reset1)
(princ)
)
;——————————————————————————-
(defun c:p2 ()
(graphscr)
(reset)
(prompt “*** PART NO. (DOUBLE) ***”)(princ)
(setq siz (getvar “dimscale”))
(setq t 1)
(setq gap (* siz 15)) ;circle diameter
(setvar “cmdecho” 0)
(setvar “osmode” 0)
(setvar “orthomode” 0)
(setq cla (getvar “clayer”))
(setq tsz (* siz 2.5))
(setq sty (getvar “textstyle”))
(setq dn1 (* siz 0.01))
(setq dn2 (* siz 1.5))
(command “layer” “s” “4” “”)
(command “osnap” “off”)
(setq pnt1 (getpoint “nSelect part :”))
(setq pnt2 (getpoint “nTo point :” pnt1))
(command “donut” dn1 dn2 pnt1 “”)
(command “line” pnt1 pnt2)
(while t
(setq pnt3 pnt2)
(setq pnt2 (getpoint “nTo point :” pnt2))
(command pnt2)
(setq e2 (entlast))
(if (= pnt2 nil)
(setq t nil)
)
)
(command “layer” “s” “1” “”)
(command “circle” pnt3 “d” gap) (setq e3 (entlast))
(setq lpt1 (polar pnt3 (dtr 0) (* siz 7.5)))
(setq lpt2 (polar pnt3 (dtr 180) (* siz 7.5)))
(command “trim” e3 “” (list e2 pnt3) “”)
(command “layer” “s” “4” “”)
(command “line” lpt1 lpt2 “”)
(command “layer” “s” “1” “”)
(if (= num nil) (setq num “”))
(setq re_num num)
(setq num (strcase (getstring (strcat “nEnter part number of the top <" (strcat num) "> :”))))
(if (= num nil) (setq num re_num))
(setvar “textstyle” “romans”)
(setq pnt3 (polar pnt3 (dtr 90) (* siz 3.5)))
(command “text” “j” “mc” pnt3 tsz “0” num)
(setq t1 (entlast))
(if (= nu1 nil) (setq nu1 “”))
(setq re_nu1 nu1)
(setq nu1 (strcase (getstring (strcat “nEnter part number of the buttom <" (strcat nu1) "> :”))))
(if (= nu1 nil) (setq nu1 re_nu1))
(setq pnt3 (polar pnt3 (dtr 270) (* siz 6.2)))
(command “text” “j” “mc” pnt3 tsz “0” nu1)
(setq t2 (entlast))
(setvar “textstyle” sty)
(reset1)
(princ)
)
==================================================================
품번 뽑는 리습입니다. 스타트 지점이 도넛이 아니라 화살표로 바꿀 수가
없어서 글을 씁니다. 바꿔주시거나 방법을 알려주시면 감사해요