- 积分
- 5163
- 明经币
- 个
- 注册时间
- 2004-1-23
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-3-26 20:39:00
|
显示全部楼层
现学现用.贴给大家共同讨论...
;ljc 2004.3 (defun c:xh(/ xx xxx cm tc os zg pt1 ss pt2 pt3 pa) (setq cm(getvar "cmdecho") tc(getvar "clayer") os(getvar "osmode")) (setq Dscale( getvar "dimscale")) (setq zg (* 4 dscale) r1 (* 3.5 dscale) ) (setvar "cmdecho" 0) (setvar "osmode" 0) (setq pt1(getpoint "\n 请输入起点:")) (while (/= nil pt1) (progn (setq ss (ssadd)) (command "-layer" "m" "dim" "c" "7" "" "") (command "circle" pt1 r1 ) (setq ss (ssadd (entlast) ss)) (command "move" (entlast) "" pt1 pause ) (setq pt2 (cdr (assoc 10 (entget(entlast)) )) ) (setq pa(angle pt2 pt1)) (setq pt3 (polar pt2 pa r1)) (command "line" pt1 pt3 "") (setq ss (ssadd (entlast) ss)) (command "-layer" "m" "text" "c" "3" "" "") (setq xx(getstring "\n请输入零件号:")) (if (= "" xx) (setq xx xxx)) (command "text" "j" "m" pt2 zg 0 xx) (setq ss (ssadd (entlast) ss)) (command "-group" "c" "*" "" ss "") (setq xxx xx) (setq pt1(getpoint "\n 请输入起点:")) ) ) (setvar "cmdecho" cm) (setvar "osmode" os) (setvar "clayer" tc) (print) )
1.提示输入零件号,输入空格---标注与上一次相同.
2.零件号字高为当前尺寸全局比例的4倍,写在text层,颜色为绿色.
3.线和圆在dim层为白色,圆半径为尺寸全局比例的3.5倍.
4.支持任意字串的标注如:1a,1b,a b ,abc....
|
|