[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Text Edits at the Command Line
Tip# 3085 By David Booth On 05-Jan-2009
2
Rated By 1 users
Categories : Tips & Tools Weekly Archive Tips
Software type : AutoCAD
Rename File To : No Files to download.
This tip is intended for users who prefer using the keyboard rather than dialog boxes.

David Booth wrote "Here's an AutoLISP routine that is quite useful for doing multiple, quick text edits at the Command line. It is intended for users who prefer using the keyboard rather than dialog boxes. It'll work on all versions of AutoCAD I've tried since R14. The last entry is saved as the default value."

;;txcl.lsp
;;text command line quick edit with default values
;;change the command prompt to any value that's quicker for you to start the routine, I use A instead of TXCL.

(defun C:TXCL ( )

(if (not old) (setq old "VALUE"))

(setq str (getstring (strcat " Enter new text <" old ">: ")))

(if (= "" str) (setq str old))

(setq TxtObj (vlax-ename->vla-object (car (entsel " Select text:"))))

(vla-put-Textstring TxtObj str)

(setq old str)

) ;end defun

NOTES FROM CADALYST TIP PATROL:
This tip gives you a quick way to change selected text items to identical text strings. It also works on mtext. You also can accomplish this task by using the Contents line of the Properties dialog box. Select all text or all mtext, and type in the desired string (for post-AutoCAD 2002 versions).

 

 

Average Rating:
2


User comments


Log In