Writing to Attributes
Writing to Attributes
(OP)
Dear Folks;
Is it possible to write text fields to exiting attributes in a bill of material line item block ?
I have old bills of material which I would like to write into new bills of material which use blocks with attributes for each line item.
Best Regards
Adrian Dunevein
www.aaadrafting.com
Is it possible to write text fields to exiting attributes in a bill of material line item block ?
I have old bills of material which I would like to write into new bills of material which use blocks with attributes for each line item.
Best Regards
Adrian Dunevein
www.aaadrafting.com





RE: Writing to Attributes
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: Writing to Attributes
(defun C:XferTextToAtt (/ ATT SS1 SS2 TXT)
(princ "Select Text:")
(setq SS1 (ssget ":S" '((0 . "TEXT")))) ;Get text entity
(setq TXT (cdr (assoc 1 (entget (ssname SS1 0)))));Return text field of text
;(princ "Select Block Att To Transfer To:")
(setq ATT (entget
(car (nentsel "\nSelect Attribute To Transfer To: "))
)
)
(setq ATT (subst (cons 1 TXT) (assoc 1 ATT) ATT))
(entmod ATT)
(command "_REGEN")
)
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: Writing to Attributes
That code does exactly what I wanted !
Best Regards
Adrian Dunevein
RE: Writing to Attributes
(defun C:XferTextToAtt (/ ATT SS1 SS2 TXT)
(princ "Select Text:")
(setq SS1 (ssget ":S" '((-4 . "<OR")(0 . "TEXT")(0 . "MTEXT")(-4 . "OR>")))) ;Get text entity
(setq TXT (cdr (assoc 1 (entget (ssname SS1 0)))));Return text field of text
(setq ATT (entget(car(nentsel "\nSelect Attribute To Transfer To: "))))
(setq ATT (subst (cons 1 TXT) (assoc 1 ATT) ATT))
(entmod ATT)
(command "_REGEN")
)
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: Writing to Attributes
Smokin !
You read my mind
Adrian