@Anonymous wrote:
Henrique i have to thanks you again because your lisp work very well! (but i removed the fist line)
i never used lisp before and i didn't understand anything about the syntax but i will read tonight about and try to adapt the code to an other bloc. but This bloc have 2 attributes and the first will need only "(" and second attribute will have ")"
my challenge this w-e will be to find How list or identify attributes in a bloc
any tip, comment or document will be accept 🙂
You're welcome, Jonathan!
The 'demo' will select 'ssget' inserts (0 . "INSERT") with the name (2 . "ANCHOR_ANNO") wite attributes (66 . 1) and color 6 (62 . 6), will exclude locked layers ":L"
Process all selected objects as vla objects, (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i))))
get the attributes as list of atributes (vlax-invoke obj "GetAttributes")
test if the atribute textstring is not empty (/= (setq str (vla-get-textstring att)) "")
and test if in atribute textstring dont exist a "(" to not add more then one if a user select the same block twice (not (vl-string-position (ascii "(") str))
if the tests are true, put the parenthesis in the textstring (vla-put-textstring att (strcat "(" str ")"))
For the other block, is the name the same?
If not, select the block chamging the name, test for the tag,
if first tag (vla-put-textstring att (strcat "(" str ))
if second tag (vla-put-textstring att (strcat str ")"))
To study the functions, open the code in vlide, highlights the function and press the button with a ? it will open the help files in the selected function...
EDIT: some sites, AfraLISP Jeffery P Sanders Lee Mac
Hope this helps,
Henrique