We often have linetypes with text to denote the type of utilities and when I came across a base dwg from a sub I was going to quickly reverse it so the text included in the lt read from the right. We have the lisp below to reverse a pline, but now I get an error message "not a closed polyline".
;; REVPOLY.LSP
;; Reverts order of vertices of a selected (not closed) polyline.
;; Supports bulge, different widthes of the polyline segments,
;; FITted and SPLINEd polylines
;; 15.04.97 S.Komarov
(defun C:REVPOLY (/ pl pln cass i ent vlist blist swl ewl)
(defun CASS (cod ent)
(cdr(assoc cod (entget ent)))
)
(setq pl (entsel "Select polyline:"))
(if pl
(progn
(setq pl (car pl))
(if (and (equal "POLYLINE" (cass 0 pl))
(/= 1 (cass 70 pl)))
(progn
(setq pln pl i 0)
(while (not (= "SEQEND" (cass 0 (setq pln (entnext pln)))))
(setq blist (cons (cass 42 pln) blist)
vlist (cons (entget pln) vlist)
swl (cons (cass 40 pln) swl)
ewl (cons (cass 41 pln) ewl)
i (1+ i)
)
)
(setq blist (append (cdr blist)(list (car blist)))
blist (mapcar '(lambda (x) (- 0 x)) blist)
swl (append (cdr swl)(list (last swl)))
ewl (append (cdr ewl)(list (last swl)))
i 0 pln pl
)
(setq ent (cdr (entget pln))
ent (subst (cons 40 (car ewl))(assoc 40 ent) ent)
ent (subst (cons 41 (last swl))(assoc 41 ent) ent)
)
(entmake ent) ; polyline
(while (not (= "SEQEND" (cass 0 (setq pln (entnext pln)))))
(progn
(setq ent (nth i vlist)
ent (subst (cons 40 (nth i ewl))(assoc 40 ent) ent)
ent (subst (cons 41 (nth i swl))(assoc 41 ent) ent)
ent (subst (cons 42 (nth i blist))(assoc 42 ent) ent)
i (1+ i)
)
(entmake ent)
))
(entmake (cdr (entget pln))); seqend
(entdel pl)(redraw(entlast))
(princ "\nDone!")
)
(prompt "\nNot a polyline or closed polyline")
)
)
(prompt "\nNothing selected!")
)
(princ)
)
(prompt "\nProgram loaded. Call by REVPOLY")(princ)
)
[/quote]
Even if the lisp worked, the 2 lines I was going to correct are Arcs. No matter which endpoint I started to re draw the arc, the text was the same direction (opposite the way I wanted).
To end this long sob story:
1. Does anyone have a lisp to reverse the direction of a pline? (to push my luck will it work on arcs?)
If anyone feels like typing, I'm curious:
2. What dictates the alignment of text (in a LT) when drawing an arc?
Tanks