(entget(car(entsel)))
(entget(car(nentsel)))
Command: (test "pole-j" "pole-no")
; error: no function definition: TEST
;; Get Attribute Value - Lee Mac
;; Returns the value held by the specified tag within the supplied block, if present.
;; blk - [ent] Block (Insert) Entity Name
;; tag - [str] Attribute TagString
;; Returns: [str] Attribute value, else nil if tag is not found.
(defun c:test ( blk tag / enx )
(if (= "ATTRIB" (cdr (assoc 0 (setq enx (entget (setq blk (entnext blk)))))))
(if (= (strcase tag) (strcase (cdr (assoc 2 enx))))
(cdr (assoc 1 enx))
(c:test blk tag)
)
)
)
(foreach att (vlax-invoke (vlax-ename->vla-object (car (entsel "pick an attributed block"))) 'getattributes)
(Princ (strcat "\ntagname is " (strcase (vla-get-tagstring att))))
)