Scott said:Hi
I was wondering how I could go about obtaining a list off all the layer names in the current drawing? I will then need to assign this list to a single variable for Vlisp.
Frank Oquendo said:How about this:
(defun laylist (/ llist lnlist)
(while (setq llist (tblnext "layer"))
(setq lnlist (cons (cdr (assoc 2 llist)) lnlist))
)
)
Jason Piercey said:Try this. Works for any table, not just the layer table.
; author - Puckett
;- string, valid table name
; returns each item name from
(defun table (s / d r)
(while (setq d (tblnext s (null d)))
(setq r (cons (cdr (assoc 2 d)) r))
)
(reverse r)
)
Examples:
(setq myListOfLayerNames (table "layer"))
(setq myListOfBlockNames (table "block"))
(setq myListOfViewNames (table "view"))
etc....
R.K. McSwain said:Yes, you are correct. That does work.
.....until you run it the second time.
R.K. McSwain said:Yes, you are correct. That does work.
.....until you run it the second time.
Frank Oquendo said:Did that limitation exist in the original routine?
Mark Propst said:compare frank's post to the one that said it didn't work