>ACAD = GETOBJECT(,"AutoCAD.Application") >DOC = ACAD.ActiveDocument > >** create a new selection set >ssnew = DOC.SelectionSets.ADD("NEWSS") > >** create the filter list. Translates to: >** '((0 . "INSERT")(2 . "DOOR")) ;only 'inserts' named 'door'. >DIME aKey[2] >DIME aVal[2] >aKey[1] = 0 >aVal[1] = "INSERT" >aKey[2] = 2 >aVal[2] = "DOOR" > >acSelectSetAll = 5 && I guessed at this. ACAD help does list the contstant value > >ssnew.SELECT(acSelectSetAll, aKey, aVal) > >** NOTE: this blows up because I couldn't figure out the correct syntax >** for the select method. (It's currently grabbing anything in the drawing > >** Spin through the selset >FOR EACH Entity IN ssnew > attribs = Entity.GetAttributes > ** spin through the attribute collection of the insert. > FOR I = 1 TO ALEN(attribs) > ? attribs(I).TagString + "=" + attribs(I).TextString > NEXT >NEXT > >**---- >;;;In case you are interested, here is the equivalent autolisp code: >(defun c:PrintAttributes (/ SSdor nLength n EntName ent_nxt sub_lst tag val) > (setq SSdoor (ssget "x" '((0 . "INSERT") (2 . "DOOR")))) > (setq nLength (sslength SSdoor)) > (setq n 0) > > (repeat nLength > (setq EntName (ssname ssDoor n)) > (setq ent_nxt (entnext EntName)) > (setq sub_lst (cdr (assoc 0 (entget ent_nxt)))) > > (while (= sub_lst "ATTRIB") > > (setq att_lst (entget ent_nxt)) > (setq tag (cdr (assoc 2 att_lst))) > (setq val (cdr (assoc 1 att_lst))) > (princ (strcat "\n" tag)) > (princ (strcat "\n" val)) > > (setq ent_nxt (entnext ent_nxt)) > (setq sub_lst (cdr (assoc 0 (entget ent_nxt)))) > > ) ;_ end of while > (setq n (1+ n)) > (princ) > ) ;_ end of repeat >) ;_ end of defun >