Integrating Lisp that gets MLEADER PROPERTIES with Excel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been trying to integrate the current code with excel. It gets the properties of the selected MLEADERS, an example of the result is (("1" "G049") ("1" "G669") ("1" "G049") ("1" "G669")), and show in the command line. I needed it to open a excel sheet and put all the results into one cell. Everyting that i could do was open excel, but i dont know how to pass a variable. Can somebody code it for me or give some tips?
(defun c:PROPRIEDADES ( / aDoc Mle MleD atrbvalues Allattrbvalues)
(defun _GetAtrID (ent / a lst)
(vlax-for itm ent
(if (eq (vla-get-Objectname itm) "AcDbAttributeDefinition")
(setq lst (cons (vla-get-ObjectID itm) lst)))
lst
)
)
(setq Allattrbvalues nil
aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(if (setq ss (ssget '((0 . "MULTILEADER"))))
(repeat (setq i (sslength ss))
(and (= (vla-get-ContentType
(setq Mle (vlax-ename->vla-object (ssname ss (setq i (1- i)))))) 1)
(setq MleD (vla-item (vla-get-blocks Adoc) (vla-get-ContentBlockName Mle)))
(setq atrbID (_GetAtrID MleD))
(setq atrbvalues (mapcar '(lambda (v)
(vla-GetBlockAttributeValue Mle v)) atrbID))
(setq Allattrbvalues (cons atrbvalues Allattrbvalues))
)
)
)
Allattrbvalues
)