发布于:2010-11-03 21:01:03
来自:建筑设计/CAD下载及教程
[复制转发]
;文字与直线平行
(DEFUN C:test(/ LINEENT TEXTENT LINEANGLE PTS PTE)
(SETQ LINEEN (ENTSEL))
(if (= (cdr(assoc 0 (entget(car lineen)))) "LWPOLYLINE")
(PROGN
(command "explode" (car lineen) "")
(alert "\n将多义线分解,请选择直线")
(SETQ LINEEN (ENTSEL"\n选择直线"))
(redraw (car lineen) 3)
(IF LINEEN
(PROGN
(SETQ LINEENT (ENTGET (CAR LINEEN)))
(SETQ PTS (cdr(assoc 10 LINEENT)))
(SETQ PTE (cdr(assoc 11 LINEENT)))
(SETQ LINEANGLE (ANGLE PTS PTE))
(SETQ TEXTEN (ENTSEL "\n选择文字"))
(redraw (car lineen) 4)
(IF TEXTEN
(PROGN
(setq obj (vlax-ename->vla-object (car texten)))
(vla-put-rotation obj LINEANGLE)
)))))
(progn
(redraw (car lineen) 3)
(SETQ LINEENT (ENTGET (CAR LINEEN)))
(SETQ PTS (cdr(assoc 10 LINEENT)))
(SETQ PTE (cdr(assoc 11 LINEENT)))
(SETQ LINEANGLE (ANGLE PTS PTE))
(SETQ TEXTEN (ENTSEL "\n选择文字"))
(redraw (car lineen) 4)
(IF TEXTEN
(PROGN
(setq obj (vlax-ename->vla-object (car texten)))
(vla-put-rotation obj LINEANGLE)
))))
(princ));DEFUN
全部回复(7 )
只看楼主 我来说两句回复 举报
回复 举报