home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
JUN93.ZIP
/
TIP880A.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1993-05-19
|
2KB
|
49 lines
;TIP 880A: XTRACT.LSP (C)1993, ROBERT L. ZIPPRICH
;-----------------------------------------------------------------
; User selects block and XTRACT creates an attribute template file
;with the same name as the block, (i.e. "ETBLOCK.TXT").
; This function searches the selected entity for attributes.
;------------------------------------------------------------------
(defun C:XTRACT ()
(Setq BLK (car (entsel "Select Block: "))
DATA (entget BLK)
NAME (cdr (assoc 2 DATA))
Ental (Entget BLK))
(if (eq 1 (CDR (Assoc 66 Ental)))
(progn
(setq file (open (strcat name ".txt") "w")
blkname (strcat "BL:" name " ")
blkname (substr blkname 1 20)
blkname (strcat blkname "C008000"))
(write-line blkname file)
(write-line "BL:X N007001" file)
(write-line "BL:Y N007001" file)
(setq blk (entnext blk)
DATA (entget BLK)
Ental (entget BLK)
l (cdr (assoc 0 data))
)
(while (eq l "ATTRIB")
(setq tag (cdr (assoc 2 data))
tag (strcat tag " ")
tag (substr tag 1 20)
tag (strcat tag "C020000")
)
(write-line tag file)
(setq blk (entnext blk)
DATA (entget BLK)
EntAL (Entget BLK)
l (cdr (assoc 0 data))
)
)
(close file)
)
(progn
; (close file)
(prompt "\n Entity has no attributes!")
)
)
) ;end xtract