-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADDATT.lsp
27 lines (27 loc) · 824 Bytes
/
ADDATT.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(defun c:add$ ( / ss i blk blks def AttObj)
(and
(setq ss (ssget '((0 . "INSERT"))))
(setq i (sslength ss))
(while (> i 0)
(setq blk (cdr (assoc 2 (entget (ssname ss (setq i (1- i)))))))
(if (not (vl-position blk blks))(setq blks (cons blk blks)))
)
)
(foreach blk blks
(setq def (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) blk))
(setq AttObj
(vla-addattribute def
8
acattributemodelockposition
"Enter Item #"
(vlax-3D-point 72 84)
"ITEM\U+0020$"
"$"
)
)
(vlax-put AttObj 'Alignment acAlignmentmiddle) ;; 4
(command "_.attsync" "_N" blk)
)
(princ)
)
(vl-load-com) (princ)