Turning text to align to a line, great tool for drafting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI There,
I have this great little lisp that helps to rotate and align text to a line, great for drafting. How can I alter this so when i select the text in the window it will ignore anything but Mtext or Text, currently it will move rotate, align everythig i select in the window.
Or better still create a new lisp refined....
Much appreciate any help.
Cheers
Allan
(PROMPT "\nLOADING FILE .........")
;
; CHANGE THE ROTATION OF SELECTED TEXT
(defun C:TT ( / selset newscl l n e as)
(setq olderr *error* *error* err)
(setq selset (ssget))
(command "undo" "begin")
(GETSYS)
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "UCS" "W")
(setq
newrot (getorient "\nNew Orientation, Pick 2 points (Return to leave same): ")
newscl (getreal "\nNew Height (Return to leave same): ")
)
(if selset
(progn
(setq l 0 n (sslength selset))
(while (< l n)
(if (wcmatch (cdr (assoc 0 (setq e (entget (ssname selset l))))) "*TEXT")
(progn
(prompt ".")
(if newscl
(progn
(setq s (cdr (setq as (assoc 40 e))))
(setq e (subst (cons 40 newscl) as e))
(entmod e)
)
)
(if newrot
(progn
(setq s (cdr (setq as (assoc 50 e)))
; cur (getvar "UCSNAME")
; n (cdr (assoc 12 (tblsearch "UCS" cur)))
; m (cdr (assoc 10 (tblsearch "UCS" cur)))
; ax (- (cadr n) (cadr m) ) bx (- (car n) (car m) )
; alpha (atan ax bx)
)
(setq e (subst (cons 50 newrot) as e))
(entmod e)
)
)
)
)
(setq l (1+ l))
)
)
)
;;LCA - COMMENT: The UCS command has new options.
(command "ucs" "p")
(command "osnap" "none")
(command "move" "P" "" pause pause)
(resetsys)
(command "undo" "end")
(princ)
)