我正在使用塔瓦特先生制定的以下程序。
- ;;; This program is working almost as well as the Autocad command attout
- ;;; so I did this program to help people who do not have the Express tools
- ;;; to use my Autolisp Program instead.
- ;;; Hope this would help people as much as it is possible.
- ;;; Author *** THARWAT AL SHOUFI ***
- ;;; Date of creating the program November 17th. 2010
- ;;; Tested with Autocad 2010
- (defun c:THattout (/ Att fNme ents e)
- ; THARWAT Nov. 17.2010
- (prompt "\n Select Attributed Block: ")
- (if
- (setq Att (ssget "_+.:S:L" '((0 . "INSERT")(66 . 1))))
- (progn
- (setq fNme
- (open "D://attributes.txt" "w"))
- (setq ents (ssname Att 0))
- (write-line
- (strcat "HANDLE" "\t" "BLOCKNAME" "\t" "\n"
- (strcat "'" (cdr (assoc 5 (entget ents))))
- "\t"
- (cdr (assoc 2 (entget ents)))
- "\t")
- fNme
- )
- (write-line
- (strcat "\n" "TAG" "\t" "VALUE")
- fNme
- )
- (while
- (not
- (eq
- "SEQEND"
- (cdr (assoc 0
- (setq e (entget (setq ents (entnext ents)))))
- )
- )
- )
- (write-line
- (strcat (cdr (assoc 2 e))
- "\t"
- (cdr (assoc 1 e)))
- fNme
- )
- )
- (close fNme)
- )
- (princ "\n No Attributed Block Selected")
- )
- (princ "\nWritten by Tharwat Al Shoufi")
- (princ)
- )
祝你好运
迈克尔 |