Message 1 of 23
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
The code belows works fine and prompts a list eg:
1 6504
1 6504
1 6512
1 5628
1 5219
1 6512
1 6512
1 6504
Can anyone help me to modify the code so that only the unique attributes values are stored into variables?
From the list above the adjusted code must store only the unique attributesvalues into serveral variables:
(setq kostenplaats01 "6504")
(setq kostenplaats02 "6512")
(setq kostenplaats03 "5628")
(setq kostenplaats04 "5219")
(defun C:FSDA (/ blkss ent foundit att comment); = block FSD's Attributes
(vl-load-com)
(if (setq blkss (setq ss (ssget "_X" '((0 . "insert")(66 . 1)(2 . "`*U*,FM_RM3")))))
(progn ; then
(prompt "\nComments:")
(repeat (sslength blkss)
(setq
ent (ssname blkss 0)
n 0
); setq
(while
(and
(not foundit)
(setq ent (entnext ent))
(= (cdr (assoc 0 (entget ent))) "ATTRIB")
); end and
(setq att (vlax-ename->vla-object ent))
(if (= (vla-get-TagString att) "KOSTENPLAATS")
(progn
(setq
foundit T
comment (vla-get-TextString att); value [= "" if none specified]
)
(prompt
(strcat
"\n" ; new line
(itoa (setq n (1+ n))); step integer upward and convert to text
" " ; space separator
(if (= comment "") "NO COMMENT SPECIFIED" comment)
); strcat
);prompt
); progn
); if
); while
(setq foundit nil)
(ssdel (ssname blkss 0) blkss)
); repeat
); progn
); if
(princ)
); defun
Thanks
Solved! Go to Solution.