- ;;没有你说的程序怪现象
- (defun C:ARCCT
- (/ ENT_SEL ENT_DATA QTY1 CB1 RAD DAD2 ATEXT1 ATEXT2 ATEXT3)
- (setq ENT_SEL (entsel "\请选取要标注的沉头圆"))
- (if (= (setq QTY1 (getstring "\n 输入沉头数量? <1> : ")) "")
- (setq QTY "1")
- )
- (if (= (setq CB1 (getstring "\n 反面(b)/<正面>: ")) "")
- (setq CB1 "c")
- (setq CB1 "b")
- )
- (setq ENT_DATA (entget (car ENT_SEL)))
- (if (= (cdr (assoc 0 ENT_DATA)) "CIRCLE")
- (progn
- (setq ENT_DATA (entget (car ENT_SEL)))
- (setq RAD (cdr (assoc 40 ENT_DATA)))
- )
- )
- (setq DAD2 (* RAD 2))
- (float DAD2)
- (setq DAD2 (rtos DAD2 2 1))
- (if (= DAD2 "6")
- (progn
- (setq DAD3 "3.4")
- (setq PITCH "3.3")
- )
- )
- (if (= DAD2 "8")
- (progn
- (setq DAD3 "4.5")
- (setq PITCH "4.4")
- )
- )
- (if (= DAD2 "9.5")
- (progn
- (setq DAD3 "5.5")
- (setq PITCH "5.4")
- )
- )
- (if (= DAD2 "11")
- (progn
- (setq DAD3 "6.6")
- (setq PITCH "6.5")
- )
- )
- (if (= DAD2 "14")
- (progn (setq DAD3 "9.0")
- (setq PITCH "8.6")
- )
- )
- (if (= DAD2 "17.5")
- (progn (setq DAD3 "11")
- (setq PITCH "10.8")
- )
- )
- (if (= DAD2 "20")
- (progn (setq DAD3 "14")
- (setq PITCH "13")
- )
- )
- (if (= DAD2 "23")
- (progn (setq DAD3 "16")
- (setq PITCH "15")
- )
- )
- (if (= DAD2 "26")
- (progn (setq DAD3 "18")
- (setq PITCH "17.5")
- )
- )
- (if (= DAD2 "29")
- (progn (setq DAD3 "20")
- (setq PITCH "20")
- )
- )
- (if (= DAD2 "32")
- (progn (setq DAD3 "22")
- (setq PITCH "22")
- )
- )
- (if (= CB1 "b")
- (setq ADEP "(背面)")
- )
- (if (= QTY1 "")
- (setq ATEXT1 (strcat "%%c" DAD2))
- (setq ATEXT1 (strcat QTY1 "-" "%%c" DAD2))
- )
- (setq ATEXT2 (strcat ATEXT1 "深" PITCH))
- (setq ATEXT3 (strcat " %%c" DAD3 "穿"))
- (setq ATEXT (strcat ATEXT2 ATEXT3))
- (if (= CB1 "b")
- (setq ATEXT (strcat ATEXT ADEP))
- )
- ;;(command "-dimstyle" "R" "螺纹")
- (command "dimdiameter" ENT_SEL "t" ATEXT PAUSE)
- ;;(command "dim" "leader" PAUSE PAUSE "" ATEXT "exit")
- ;;(command "-dimstyle" "R" "Standard")
- (princ)
- )
|