Spoke too soon...there is sumthin' I do not understand I didnt understand why the "if" statement and the "progn" statement where necessary in this program....I omitted them and it still seems to work fine...Are they in there because its just "good programming habits" that you have, that I dont understand or does omitting them sacrafice the integrity of the routine?
I hope this is not coming across wrong dude, just curious
(defun c:LTC (/ str ent lay_name LAY)
;; create empty string
(setq str "")
(while
;; loop while selection continues
(setq ent (car (entsel "\nSelect an item <enter to exit>: ")))
;; extact layer name from selected entity
(setq lay_name (cdr (assoc 8 (entget ent))))
;; show the user which layer they picked
(prompt lay_name)
;; create one long string of layer names
(setq str (strcat str (strcat lay_name ",")))
) ; end of loop
;; we need to make sure 'str' is not empty
;(if (not (= str ""))
;(progn
;; remove the last ',' from the string
(setq str (substr str 1 (1- (strlen str))))
(setq LAY (open "C:/LAY-INFO.TXT" "w"))
(write-line str LAY)
(close LAY)
(princ)
)