lisp写的粗糙度怎么不能在尺寸线上用呀
大家帮我看一下,我的粗糙度程序为什么不能在尺寸线上用呀 谢谢了先(defun c:ccd()
(vl-load-com)
(setq chklay (tblsearch "layer" "尺寸线"))
(if (= chklay nil)
(command "layer" "n" "尺寸线" "c" "3" "尺寸线" ""))
(setq chksty (tblsearch "style" "数字 txt 3.5" ))
(if (= chksty nil)
(command "style" "数字 txt 3.5" "txt.shx" "3.5" "0.7" "" "" "" ""))
(command "layer" "M" "尺寸线" "")
(setvar "osmode" 0)
(command "osnap" "end,mid,nea")
(setq a (vlax-ename->vla-object (car (entsel))))
(setq b (getpoint "请选择标注位置:"))
(setq c (vlax-curve-getparamatpoint a b))
(setq d (vlax-curve-getfirstderiv a c))
(setq e (atan (cadr d) (car d)))
(setq m (polar b (+ e (/ pi 2)) 100))
(setq n (polar b (- e (/ pi 2)) 100))
(setq s (getpoint "标注方向:"))
(setq u (distance s m))
(if (< u 100) (setq ang0 (angle n m)) (setq ang0 (angle m n)))
(setq ang30 (/ pi 6))
(setvar "osmode" 0)
(setq s (getint "\n 请选择标注符号:1.去除材料:2.不去除材料:3.任何方法:<1>:"))
(if (= s nil)
(setq s 1))
(if (= s 1)
(progn
(setq v (getreal "\n 粗糙度的值:<3.2>")) ;
(if (= v nil)
(setq v 3.2))
(setq value (rtos v 2 1))
(command "lweight" 0.15)
(command "line"
(polar b (- ang0 ang30) 11.5)
b
(polar b (+ ang0 ang30) 5.8)
(polar b (- ang0 ang30) 5.8)
""
)
(if (and (> ang0 0) (<= ang0 pi)) ;
(setq angt (+ ang0 pi))
(setq angt ang0)
)
(setq angt (+ angt (* 0.5 pi)))
(command "mtext"
(polar b ang0 7)
"j" "mc" "r" (/ (* 180 angt) pi) "h" 2.5 "w" 6 value "")
)
)
(if (= s 2)
(progn
(setq v (getreal "\n 粗糙度的值:<3.2>")) ;
(if (= v nil) (setq v 3.2))
(setq value (rtos v 2 1))
(command "circle" (polar b ang0 (* 2 1.674316)) 1.674316)
(command "lweight" 0.15)
(command "line"
(polar b (- ang0 ang30) (* 2 5.8))
b
(polar b (+ ang0 ang30) 5.8)
""
)
(if (and (> ang0 0) (<= ang0 pi)) ;
(setq angt (+ ang0 pi))
(setq angt ang0)
)
(setq angt (+ angt (* 0.5 pi)))
(command "mtext"
(polar b ang0 7)
"j" "mc" "r" (/ (* 180 angt) pi) "h" 2.5 "w" 6 value "")
)
)
(if (= s 3)
(progn
(setq v (getreal "\n 粗糙度的值:<3.2>")) ;
(if (= v nil) (setq v 3.2))
(setq value (rtos v 2 1))
(command "lweight" 0.15)
(command "line"
(polar b (- ang0 ang30) (* 2 5.8))
b
(polar b (+ ang0 ang30) 5.8)
""
)
(if (and (> ang0 0) (<= ang0 pi)) ;
(setq angt (+ ang0 pi))
(setq angt ang0)
)
(setq angt (+ angt (* 0.5 pi)))
(command "mtext"
(polar b ang0 7)
"j" "mc" "r" (/ (* 180 angt) pi) "h" 2.5 "w" 6 value "")
)
)
(setvar "osmode" 0)
(setvar "osmode" 15359)
)
页:
[1]