- 积分
- 2455
- 明经币
- 个
- 注册时间
- 2003-8-12
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-3-3 17:58:00
|
显示全部楼层
下面的代码可以标注两线之间的,但不能标注更多的
并且线不能是多义线,我现在要标注多个,不分什么线
请教高手:
(defun c:qw( / ); ang ang1 co os pt0 pt01 pt1 pt2 pt3 pt4 ;pta pta1 ptaa ptb ptb1 ptbb sname ss) (setvar "cmdecho" 0) (setq co (getvar "cecolor")) (setq os (getvar "osmode")) (setq pt01 (getpoint "输入第一点\n")) (setq pt02 (getpoint "输入第二点\n" pt01)) (setq ss (ssget "C" pt01 pt02))
(setq ss1name (ssname ss 0)) (setq ss1 (entget ss1name)) (setq pt11 (cdr(assoc 10 ss1))) (setq pt12 (cdr(assoc 11 ss1))) (setq ss2name (ssname ss 1)) (setq ss2 (entget ss2name)) (setq pt21 (cdr(assoc 10 ss2))) (setq pt22 (cdr(assoc 11 ss2))) (setq pt31 (inters pt01 pt02 pt11 pt12)) (setq pt32 (inters pt01 pt02 pt21 pt22)) (setq ang (angle pt31 pt32)) (if (>= ang pi) (progn (setq ptaa pt32)(setq ptbb pt31) (setq ang (- ang pi))) (progn (setq ptaa pt31)(setq ptbb pt32)) ) (setvar "osmode" 0) (cond ((= (angle pt01 pt02) 0) (command "dimlinear" ptaa ptbb "@0,550")) ((= (angle pt01 pt02) pi) (command "dimlinear" ptaa ptbb "@0,-550")) ((= (angle pt01 pt02) (/ pi 2)) (command "dimlinear" ptaa ptbb "@-550,0")) ((= (angle pt01 pt02) (* pi 1.5)) (command "dimlinear" ptaa ptbb "@550,0")) );end cond
(setvar "cecolor" co) (setvar "osmode" os) (setvar "cmdecho" 1) (princ) ) |
|