Tap, tap, tap....Is this thing on?
Registered forum members do not see this ad.
Is there a clean way of extracting block handles based upon block names? How about the handles of the attributes nested in the blocks?
Will Data Extraction do it and I just can't find the right settings?
Last edited by DNK; 18th Feb 2010 at 09:05 pm.
Tap, tap, tap....Is this thing on?
Yes it is. Thanks for checking.
Have you done an Internet search?
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!
Of course. And I've gotten a mixture of ATTOUT, Data Extraction, a lot of stuff concerning Tables, but it's not quite what I'm looking for.
I was more looking along the lines of getting the information in a drawing by drawing manner, of the data that is defined using the LIST command, but isolated to only blocks, based upon block name with a wildcard. It'd also be nice to be able to select only the data I need.
Hey DNK, nice to see you in these parts
Perhaps a custom LISP may accomplish this task - what would you extract to?
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Is it just the attribute tags and relevant handles you want extracted, or block (insert) handles as well?
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Try this mate:
Code:(defun c:BlockOut (/ *error* lst2str FILE IATT IBLK INFO OFILE SS) (vl-load-com) (defun *error* (msg) (and ofile (close ofile)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (defun lst2str (lst del) (if (cdr lst) (strcat (car lst) del (lst2str (cdr lst) del)) (car lst))) (if (and (ssget '((0 . "INSERT"))) (setq file (getfiled "Output File" "" "csv" 1))) (progn (vlax-for obj (setq ss (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)))) (setq iBlk (list (if (vlax-property-available-p obj 'EffectiveName) (vla-get-EffectiveName obj) (vla-get-Name obj)) (vla-get-Handle obj))) (if (eq :vlax-true (vla-get-HasAttributes obj)) (foreach att (vlax-invoke obj 'GetAttributes) (setq iAtt (cons (list (vla-get-TagString att) (vla-get-Handle att) (vla-get-TextString att)) iAtt)))) (setq Info (cons (cons iBlk iAtt) Info) iBlk nil iAtt nil)) (vla-delete ss) (setq ofile (open file "w")) (foreach b Info (write-line (lst2str (car b) ",") ofile) (foreach a (cdr b) (write-line (lst2str a ",") ofile)) (write-line "" ofile)) (setq ofile (close ofile)))) (princ))
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Registered forum members do not see this ad.
Did my code work for you DNK?
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Bookmarks