Message 1 of 16
Rotate & Move Text
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We waste so much time adjusting little text labels, mainly spot elevations.
So I made this up this morning...
Enjoy, OR ELSE!
(defun C:R+M ( / *error* vars vals e obj objname ip rot) ;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ;* * ;* R+M.LSP by John F. Uhden * ;* 2 Village Road * ;* Sea Girt, NJ 08750 * ;* * ;* * * * * * * * * * * * Do not delete this heading! * * * * * * * * * * * * ; Program combines rotating and moving text/mtext objects just to save time ; adjusting their position for neatness and legibility. ; v1.0 (01-17-2020) made for Challoner (gc) (prompt "\nR+M v1.0 (c)2020, John F. Uhden") (defun *error* (error) (sssetfirst) (mapcar 'setvar vars vals) (vla-endundomark *doc*) (cond (not error) ((wcmatch (strcase error) "*CANCEL*,*QUIT*") (vl-exit-with-error "\r ") ) (1 (vl-exit-with-error (strcat "\r*ERROR*: " error))) ) (princ) ) ;;------------------------------------------ ;; Intitialize drawing and program variables: ;; (setq *acad* (vlax-get-acad-object)) (setq *doc* (vlax-get *acad* 'ActiveDocument)) (vla-endundomark *doc*) (vla-startundomark *doc*) (setq vars '("cmdecho" "highlight")) (setq vals (mapcar 'getvar vars)) (mapcar 'setvar vars '(0 1)) (command "_.expert" (getvar "expert")) ;; dummy command (while (setq e (car (entsel "\nSelect text object to rotate/move: "))) (setq obj (vlax-ename->vla-object e) objname (vlax-get obj 'ObjectName) ) (and (or (wcmatch (strcase objname) "*TEXT") (prompt "\nObject selected is not text.") ) (setq ip (vlax-get obj 'InsertionPoint)) (setq rot (vlax-get obj 'Rotation)) (princ "\nNew rotation: ") (vl-cmdf "_.rotate" e "" "_non" ip "_R" (angtos rot 0 4)) (while (> (getvar "cmdactive") 0)(vl-cmdf pause) 1) (princ "\nNew position: ") (vl-cmdf "_.move" e "" "_non" ip) (while (> (getvar "cmdactive") 0)(vl-cmdf pause) 1) ) ) (*error* nil) ) (defun c:RM ()(c:R+M))
John F. Uhden