Autolisp using an attribue name as a variable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a block with 25 and growing attributes and corresponding global variables.
(defun attdraw (atthandle / ) ; draw out all attributes of the insert, turn them into global variables and fill them with
(setq ent (handent atthandle) ; their corresponding data. attribute name = global variable name.
ed (entget ent)
);setq
(while
(/= "SEQEND" (dxf 0 ed)) ;while tag value /= SEQEND
(if (= "ATTRIB" (dxf 0 ed)) ;make sure its an attribute
(set (read (dxf 2 ed)) (dxf 1 ed))
);if
(setq ent (entnext ent) ;move to the next tag
ed (entget ent) ;and get entity data
);setq
);while
);defun
i update the variables in a dialog box.
exiting the dialog box i update the global variables
i would like to then insert the values back into the attributes using something similar.
is there a way to use the attribute names as variable names and also use the values associated with them to push them back into the attributes.