TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dubb on June 19, 2017, 02:36:51 PM
-
I would like to know how to edit a specific tag in an attribute without having to explicitly defining the tag id. I have seen this somewhere before I can't recall where.
In case I had a block with two attribute tags I would like to click on either text it would edit that specific tag. See attached for an example of the block. If someone could help me out with some sample code. Much appreciated. Thanks.
*Would like to utilize entsel or entmod to edit the attribute*
-
Maybe:
You can also hold down CNTRL and double click the attribute to edit with out the 'Enhanced Attribute Editor".
-
That is exactly what I'm looking for. Thanks Ron.
Maybe:
You can also hold down CNTRL and double click the attribute to edit with out the 'Enhanced Attribute Editor".
-
Glad to help :)
-
Here is what I a made.
Next thing I want to do is update or edit an attribute in a block without having to define the tag id. The block only has one attribute.
;select text or mtext
;select attribute
;edits attribute with text
(defun c:atxt (/ e)
(setq txt (cdr(assoc 1 (entget(car(entsel))))))
(if (and (setq e (car (nentsel))) (= "ATTRIB" (cdr (assoc 0 (setq e (entget e))))))
(entmod (subst (cons 1 txt) (assoc 1 e) e))
)
(princ)
)