Message 1 of 15
Not applicable
06-12-2018
08:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The attached block has several att, I would like to number with a prefix TAG = Number,
, why does not the code work?
(defun c:Test (/ dat ent etdata found post pre ss1)
(setq pre (getstring "\nPrefix: ")
post (1- (getint "\nSufix: ")))
(while
(setq ss1 (ssget ":s" '((0 . "insert") (66 . 1))))
(setq found ()
dat (strcat pre (itoa (setq post (1+ post))))
ent (ssname ss1 0))
(while (and (setq ent (entnext ent)) (null found))
(setq etdata (entget ent))
(and (= (cdr (assoc 0 etdata)) "ATTRIB")
(= (cdr (assoc 2 etdata)) "ADSKFACTORY:Custom.ASSET_TAG")
(setq found t)
(entmod
(subst (cons 1 dat) (assoc 1 etdata) etdata)
)
)
)
)
(princ)
)
Solved! Go to Solution.