TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Aldo on December 27, 2022, 08:52:13 PM
-
The ATTOUT command allows me to export the attributes and the Handle of the blocks, the issue is that I have to select them one by one to obtain this information, the question is, is there any way to extract this information in a massive way without selecting each one of them? maybe just giving the name of each block and extract this data, very grateful for the support provided.
-
Dataextraction type it and follow the prompts.
The other way is a custom extract routine. There are just to many if and buts to answer that custom question. It depends on 1 block name or multiple names, all atts or just some, total blocks and so on.
If you describe clearly what it is your trying to export out then someone may have a solution already.
-
Your not using attout correctly. You can select as many blocks as you want to display in the output file.
-
lee mac made a Lips but it does not export the handle, I am putting the link so you can get an idea of what I need, this routine is very good, it is just what I need but the handle is missing, very grateful for the prompt responses.
http://www.lee-mac.com/macatt.html
-
Did you send a message to Lee he has a Contact me on his web page Lee-mac.com.
The code is massive and impressive as usual but complicated to find the right point in code to add the Handle as an item.
-
I found this lisp but i get this: error: no function definition: ATT:SORT, can you help me correct this error?
(defun c:attt (/ ss l ls f fn bn b)
;; put your error handle here
(foreach x
(reverse ((lambda (i / l)
(while (setq b (tblnext "BLOCK" (not b)))
(setq ls (cons
(cons (setq i (1+ i))
(cdr (assoc 2 b))
)
ls
)
)
)
)
-1
)
)
(terpri)
(princ x)
)
(textscr)
(initget 5)
(if
(and (setq i (getint "\nIndex for block name? : "))
(< i (length ls))
(setq bn (cdr (assoc i ls)))
(setq l (att:sort bn 1 >)) ;;; here to adjust, (1) indicates sorting Y-coordinates, (>) Z-A
(setq fn (vl-filename-mktemp
"att-"
nil
".txt"
)
)
(setq f (open fn "w"))
)
(progn (foreach x l
(write-line x f)
)
(if f
(close f)
)
(vl-cmdf "_START" (strcat "EXCEL " fn))
)
(princ "\nInvalid block selections!")
)
(princ)
)
-
I found this lisp but i get this: error: no function definition: ATT:SORT, can you help me correct this error?
[...]
I tried googling it and found the att:sort function here: https://www.cadtutor.net/forum/topic/70324-export-attribute/#comment-564680