;文字与直线平行(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将多义线分解,请选择直线")
(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