Auto Lisp 快速上手應用小程式 - E04

  • Share this:

Substitute text

This program lets you choose a line of text and substitute another line at exactly the same place.

(defun c:subtext (/ a b d e d1 b1 y)

(prompt "nSelect text line: ")

(setq a (entsel))

(setq b (entget (car a)))

(setq d (assoc 1 b))

(prompt (cdr d))(terpri)

(setq e (getstring 1))

(setq d1 (cons (car d) e))

(setq b1 (subst d1 d b))

(entmod b1)

(setq y (getstring "nIs this correct - Y : "))

(if (= (srtcase y) "N") (entmod b))

(princ)

)


Tags: