- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have set of text in notepad that I need to compare against text in autocad drawing.
If matched, the text in autocad will have to change into another colour.
Got a friend help for writing a lisp, but don't seem to work.
Need help!
(defun C:read_file (/ TXT_FILE)
(setq TXT_FILE (getfiled "Select Text File" "" "txt" 1))
(if TXT_FILE
(progn
(setq INPUT (open TXT_FILE "r"))
(setq LINE (read-line INPUT))
(while LINE
(setq TEXT (car (read (" LINE "))))
(setq PT (cdr (read (" LINE "))))
(command "_.line" (car PT) (cadr PT) (car (cdr PT)) (cadr (cdr PT)))
(setq LINE (read-line INPUT))
)
(close INPUT)
(princ "\n Done!")
)
)
)
(defun C:color_text (/ SS INPUT VALUE)
(setq INPUT (open "C:\\Temp\\TextValues.txt" "r"))
(while (setq VALUE (read-line INPUT))
(setq SS (ssget "_X" '((0 . "TEXT")(1 . VALUE))))
(if (/= SS nil)
(foreach OBJ (mapcar 'cadr (ssnamex SS))
(setq OBJ (entmod (subst '(62 . 1) '(62 . 2) (entget OBJ))))
)
)
)
(close INPUT)
(princ "\n Done!")
)
Thank you
Solved! Go to Solution.