- UID
- 204504
- 积分
- 35
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-12-20
- 最后登录
- 1970-1-1
|
发表于 2007-8-20 01:08:35
|
显示全部楼层
程序前请先设置当前字体的高度!
(defun c:bz1() ;标注1
(command"cmdecho" 0)
(setq len (getreal "三角形边长:") )
(setq linelen (abs (getreal "标注线边长:")))
(setq blkr (strcat "blkr" (rtos len 2 2) (rtos linelen 2 2)) )
(setq blkl (strcat "blkl" (rtos len 2 2) (rtos linelen 2 2)) )
(setq pt2x (* len 0.5) pt2y (* len 0.866) pt3x (* len -0.5) pt3y (* len 0.866))
(if (not (tblsearch "block" blkr))
(progn
(command"pline" (list pt2x pt2y) "0,0" (list pt3x pt3y) (list (+ pt2x linelen) pt2y) "")
(command"block" blkr "0,0" "l" "")
)
)
(if (not (tblsearch "block" blkl))
(progn
(command"pline" (list pt3x pt3y) "0,0" (list pt2x pt2y) (list (- pt3x linelen) pt3y) "")
(command"block" blkl "0,0" "l" "")
)
)
(setq osmode (getvar"osmode"))
(while (setq pt1 (getpoint "选标注点:"))
(setq pt1x (nth 0 pt1) pt1y (nth 1 pt1))
(setq pt9 (getpoint "标注方向:"))
(setq pt9x (nth 0 pt9) pt9y (nth 1 pt9))
(setq pt2x (+ pt1x (* len 0.5)) pt2y (+ pt1y (* len 0.866)) )
(setq pt3x (+ pt1x (* len -0.5)) pt3y (+ pt1y (* len 0.866)) )
(if (> pt9x pt1x)
(progn
(command"insert" blkr (list pt1x pt1y) "1" "1" "0")
(command"text" "j" "m" (list (+ pt2x (* linelen 0.5)) (+ pt2y (* texth 0.7))) "0" (rtos pt1y 2 3) )
)
(progn
(command"insert" blkl (list pt1x pt1y) "1" "1" "0")
(command"text" "j" "m" (list (- pt3x (* linelen 0.5)) (+ pt3y (* texth 0.7))) "0" (rtos pt1y 2 3) )
)
)
(print)
)
(princ)
) |
|