AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

One of your readers asked about a attribute extract program
Here is one for you.
Have a great day

Peter Jamtgaard
----------------------------

;CODING STARTS HERE
(defun C:Get_Attributes (/ ATTLIST ELST ENT ETYP )
(setq ENT (car (entsel "\nSelect block: "))
ELST (entget ENT)
ETYP (cdr (assoc 0 ELST))
)
(if (= ETYP "INSERT")
(if (assoc 66 ELST)
(princ (setq ATTLIST (atts_to_list ENT)))
(princ "\nThat block doesn't have attributes: ")
)
(princ "\nThat is not a block! ")
)
(prin1)
)
(defun ATTS_TO_LIST (ENAM)
(setq X (vlax-ename->vla-object ENAM))
(if (= (cdr (assoc 66 (entget ENAM))) 1)
(progn
(mapcar '(lambda (X) (cons (vla-get-tagstring X)
(vla-get-textstring X)
)
)
(vlax-safearray->list
(variant-value
(vla-getattributes
(vlax-ename->vla-object ENAM)
)
)
)
)
)
)
)
;CODING ENDS HERE

The AutoLisp/Visual Lisp/VBA Resource Website

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website