I am trying to learn how to manipulate attributes. They are a bit weird for me to grasp. I am also looking for some tutorials. I think I am having trouble identifying the entity handles.
My block attribute has a single tag and attribute text set to invisible.
(entget(car(entsel)))
(entget(car(nentsel)))
If the text was not set as invisible I could see the the dotted pair (1 . "attribute-info")
http://www.lee-mac.com/attributefunctions.htmlThanks for the info Lee Mac
So while looking into how they can be manipulated, how do I test this?
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)
)
)
)