NWood
Computer
- Feb 2, 2006
- 1
Hi, i have these few lines of lisp code which can automatically extract attributes from blocks which are in an X-Ref. i was wondering if anyone knows of a VBA equivalent to this code
Lisp:
(defun c:xrefatts ()
(setq ename (nentsel "\nSelect block in xref: "))
(if (= (length (nth 3 ename)) 2)
(progn
(setq attlist
(setq obj (vlax-ename->vla-object (car (nth 3 ename))))
)
(mapcar
'(lambda (Att)
(cons (vla-get-TagString Att) (vla-get-TextString Att))
)
(vlax-invoke Obj "GetAttributes")
)
)
;else
(alert "Object selected is not a block")
)
)
I want to be able to return the attributes as variables and maybe display them in a MsgBox too. any help would be greatly appreciated
thanks
Lisp:
(defun c:xrefatts ()
(setq ename (nentsel "\nSelect block in xref: "))
(if (= (length (nth 3 ename)) 2)
(progn
(setq attlist
(setq obj (vlax-ename->vla-object (car (nth 3 ename))))
)
(mapcar
'(lambda (Att)
(cons (vla-get-TagString Att) (vla-get-TextString Att))
)
(vlax-invoke Obj "GetAttributes")
)
)
;else
(alert "Object selected is not a block")
)
)
I want to be able to return the attributes as variables and maybe display them in a MsgBox too. any help would be greatly appreciated
thanks