Im, trying to solve an easy problem for someone with more knowledge than me but for me a big one.
I have multiple blocks/dynamic blocks inside a drawing and i would like to see if it cointain a attribute with specific name and value and then if it exists update another one.
I would be more than happy if someone could finish and help me with this code. and i would be even more grateful if comments in the code.
So.
Loop all blocks
Has attribute SEKTION with value sek_num
Then:
Change attribute SEK_SIDA to sek_page
This i what i got so far and finding some code from lee mac.
(defun C:adress_se_blad (/ ss i ename)
(setq sek_num (getstring "Search for section number:"))
(setq sek_page (getstring "In wich page?"))
(while
(not(eq "SEQEND"(cdr(assoc 0(entget(setq bEnt(entnext bEnt)))))))
(if (eq "SEKTION" (cdr (assoc 2 (entget bEnt))));Has attribute name
(entupd
(cdr
(assoc -1
(entmod(subst(cons 1 "Lee Mac") (assoc 1 (entget bEnt)) (entget bEnt)
)
)
)
)
)
)
)
);end
Solved! Go to Solution.
Link copied