你好,
有人能帮我一下吗,我一直在尝试更改我使用的一个有用的lisp的属性。
每次拾取点时,lisp都会给我一个级别值,但我想更改线型和点标记。
有人知道如何改变这一点吗?
提前谢谢。
内利。
下面是Lisp。
- (defun c:txm()
- (terpri)
- ;; Perform math on text numbers in-place, by Carl B., coded March 2000
- (setvar "cmdecho" 0)
- ;; select lines to annotate
- (setq mfactor 1 afactor 0 input nil)
- (initget "M A")
- (setq input (getkword "\nMultiply<M> or Add<A>?: "))
- (cond
- ((= input "M") (initget 1)
- (setq mfactor (getreal "\nMult Factor: ")))
- ((= input "A") (initget 1)
- (setq afactor (getreal "\nAdd Amount: ")))
- (T nil)
- ) ; cond
- (initget 1)
- (setq precis (getint "\nPlaces after decimal: "))
- (setq units (getstring T "\nEnter units to append: "))
- (princ "\nSelect text to revise: ")
- (setq textset nil)
- (while (not textset) (setq textset (ssget '((0 . "*TEXT")))))
- (setq numitems (sslength textset))
- ;; loop to isolate text & change text
- (setq itemno 0)
- (repeat numitems
- (setq entname (ssname textset itemno))
- ;;(setq enttype (cdr (assoc 0 (entget entname))))
- (setq oldtxt_pr (assoc 1 (entget entname)))
- (setq oldtxt (cdr oldtxt_pr))
- (setq oldtext# (atof oldtxt))
- (setq newtext# (+ (* oldtext# mfactor) afactor))
- (setq newtxt (strcat (rtos newtext# 2 precis) units))
- (setq newtxt_pr (cons 1 newtxt))
- (setq entstuff (entget entname))
- (setq entstuff (subst newtxt_pr oldtxt_pr entstuff))
- (entmod entstuff)
- (setq itemno (1+ itemno))
- ) ; repeat
- (princ)
- ) ; the end
- (princ "Do math on text Start with "TXM"")
- (princ)
|