我只是因为日期(1990年3月9日)才想发布它,但经过快速测试,我发现它非常有用,在autocad 2012中可以开箱即用,尽管它的年龄几乎是四分之一世纪!
- ;;; CHTEXT.lsp
- ;;; Copyright (C) 1990 by Autodesk, Inc.
- ;;;
- ;;; Permission to use, copy, modify, and distribute this software and its
- ;;; documentation for any purpose and without fee is hereby granted.
- ;;;
- ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
- ;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
- ;;; MERCHANTABILITY ARE HEREBY DISCLAIMED.
- ;;;
- ;;; by Jan S. Yoder
- ;;; 09 March 1990
- ;;;
- ;;;--------------------------------------------------------------------------;
- ;;; DESCRIPTION
- ;;; This is a "text processor" which operates in a global manner
- ;;; on all of the text entities that the user selects; i.e., the
- ;;; Height, Justification, Location, Rotation, Style, Text, and
- ;;; Width can all be changed globally or individually, and the
- ;;; range of values for a given parameter can be listed.
- ;;;
- ;;; The command is called with CHT from the command line at which
- ;;; time the user is asked to select the objects to change.
- ;;;
- ;;; Select text to change.
- ;;; Select objects:
- ;;;
- ;;; If nothing is selected the message "ERROR: Nothing selected."
- ;;; is displayed and the command is terminated. If more than 25
- ;;; entities are selected the following message is displayed while
- ;;; the text entities are sorted out from the non-text entities.
- ;;; A count of the text entities found is then displayed.
- ;;;
- ;;; Verifying the selected entities -- please wait.
- ;;; nnn text entities found.
- ;;; CHText: Height/Justification/Location/Rotation/Style/Text/Undo/Width:
- ;;;
- ;;; A typical example of the prompts you may encounter follows:
- ;;;
- ;;; If you select a single text entity to change and ask to change
- ;;; the height, the prompt looks like this:
- ;;;
- ;;; CHText: Height/Justification/Location/Rotation/Style/Text/Undo/Width:
- ;;; New text height for text entity. <0.08750000>:
- ;;;
- ;;; If you select more than one text entity to change and ask to change
- ;;; the height, the prompt looks like this:
- ;;;
- ;;; CHText: Height/Justification/Location/Rotation/Style/Text/Undo/Width:
- ;;; Individual/List/<New height for all entities>:
- ;;;
- ;;; Typing "L" at this prompt returns a prompt showing you the range of
- ;;; values that you are using for your text.
- ;;;
- ;;; Height -- Min: 0.05000000 Max: 0.10000000 Ave: 0.08392857
- ;;;
- ;;; Typing "I" at this prompt puts you in a loop, processing the text
- ;;; entities you have selected one at a time, and giving the same prompt
- ;;; you get for a single text entity shown above.
- ;;;
- ;;; Pressing RETURN at this point puts you back at the Command: prompt.
- ;;; Selecting any of the other options allows you to change the text
- ;;; entities selected.
- ;;;
- ;;; All of the Release 11 text alignment options have been supported.
- ;;; This is based on the system variable "DIMCLRD" being present.
- ;;; If it is not present, then only the Release 10 alignment options
- ;;; are allowed.
- ;;;
- ;;;---------------------------------------------------------------------------;
- ;;;
- ;;; Main function -- no arguments
- ;;;
- (defun chtxt (/ sset opt ssl nsset temp unctr
- sslen style hgt rot txt ent cht_oc
- loc loc1 justp justq orthom )
- (setq pt_ver "1.00") ; Reset this local if you make a change.
- ;;
- ;; Internal error handler defined locally
- ;;
- (defun cht_er (s) ; If an error (such as CTRL-C) occurs
- ; while this command is active...
- (if (/= s "Function cancelled")
- (if (= s "quit / exit abort")
- (princ)
- (princ (strcat "\nError: " s))
- )
- )
- (eval(read U:E))
- (if cht_oe ; If an old error routine exists
- (setq *error* cht_oe) ; then, reset it
- )
- (if cht_oc (setvar "cmdecho" cht_oc)) ; Reset command echoing
- (if cht_ot (setvar "texteval" cht_ot))
- (if cht_oh (setvar "highlight" cht_oh))
- (princ)
- )
- ;;
- ;; Body of function
- ;;
- (if *error* ; Set our new error handler
- (setq cht_oe *error* *error* cht_er)
- (setq *error* cht_er)
- )
- ;; Set undo groups and ends with (eval(read U:G)) or (eval(read U:E))
- (setq U:G "(command "undo" "group")"
- U:E "(command "undo" "end")"
- )
-
- (setq cht_oc (getvar "cmdecho"))
- (setq cht_oh (getvar "highlight"))
- (setvar "cmdecho" 0)
-
- (eval(read U:G))
|