Sliding text
I miss not having a routine to slide text along its insertion angle axis.
Yes there are some routines that do this but not as simply as just grabbing the text and pushing the mouse around in the x & y axis or tilted as the case in rotated text is.
Is there a Lisp routine that does that please?
Comments
-
Richard, this is what I use, it may be helpful to you... ( made a couple of edits, hopefully no oops!)
(defun TSLIDE ( / *error* oom osa oos oce te en)
;;;=============================================================================
;;; A text slide function making use of ortho and snapang with move command.
;;;=============================================================================
;;;=========================================================================
;; Define the local error handler
(defun *error* (msg)
;; Reset system variables to user values
(if oom (setvar "ORTHOMODE" oom))
(if osa (setvar "SNAPANG" osa))
(if oos (setvar "OSMODE" oos))
(if oce (setvar "CMDECHO" oce))
;; Make sure the entity is not highlighted
(if en (redraw (car en) 4))
)
;;;=========================================================================
;; Get user to select a text or mtext
(while (not te)
(if (setq en (entsel "Select text to slide: "))
(cond
((wcmatch (cdr (assoc 0 (setq te (entget (car en))))) "*TEXT")
te)
(T
(setq te NIL)))))
;; Save the user's preferences for the system variables
(setq oom (getvar "ORTHOMODE"))
(setq osa (getvar "SNAPANG"))
(setq oos (getvar "OSMODE"))
(setq oce (getvar "CMDECHO"))
;; Set snapang to text rotation, ortho on, cmdecho off and osmode off
(setvar "ORTHOMODE" 1)
(setvar "SNAPANG" (cdr (assoc 50 te)))
(setvar "OSMODE" 0)
(setvar "CMDECHO" 0)
;; Run the move command with a pause for the displacement point
(command "_MOVE" (cdr (assoc -1 te)) "" (cadr en) pause)
(while (> (getvar "CMDACTIVE") 0)
(command pause))
;; Restore the system variables to user's settings.
(setvar "ORTHOMODE" oom)
(setvar "SNAPANG" osa)
(setvar "OSMODE" oos)
(setvar "CMDECHO" oce)
;; Exit quietly
)
(princ)0 -
Hi Richard,
Since you are a GeoTools user, you can use the GT_TXTSLIDE command in GeoTools to slide text about its insertion point and along the direction of its rotation angle.
http://www.4d-technologies.com/geotools/manual/text_tools.htm#TXTSLIDE
Regards
Rakesh0 -
Rakesh your routine is very good for precise movements but its the 'on the fly' active movements I am used to.
Just invokd the command and select a text and it slides the text along both axis of the inserted text (or blockl).
Just get the text to where you want it and let go with mouse.
Greg - I loaded that routine but it doesn't recognise.
Maybe doing something wrong at this end? But I have got other routines to work.
I gather its a Lisp routine? I saved it as TSLIDE.lsp.
regards
Richard0 -
Richard: one of those edit-as-posting problems :-( Chage the name of the function from TSLIDE to C:TSLIDE load your TSLIDE.LSP and you should be able to run the function using command TSLIDE.
(defun C:TSLIDE ...
0 -
thanks Greg
- yes works well thanks.
I see it is a once only routine and I wonder if there is a way to make these sort of routines persistent (is that the right word) where they keep active until user closed?
But this works well thanks - so much appreciated.
regards
0 -
Hi Richard,
We have updated the GT_TXTSLIDE command in the latest version 12.18 of GeoTools. You can now slide individual text/mtext along and perpendicular to the rotation angle of text objects. It is possible using the new "Interactive" mode.
Regards
Rakesh Rao
http://rakeshrao.typepad.com0