Alert list of layouts with commas

Alert list of layouts with commas

jr_olmos23
Enthusiast Enthusiast
286 Views
3 Replies
Message 1 of 4

Alert list of layouts with commas

jr_olmos23
Enthusiast
Enthusiast

Someone in this forum once modified an existing lisp for me (attached), and it works great! I changed a few things here and there, but one thing I'm struggling to figure out is how to make the alert display the layouts' names (if applicable) with a comma in between. I think it might be something to do with this line if I'm correct, I just cant figure it out:

;; Instead of updating the attribute, display the layout name
(alert (strcat "\nBlock is located in layout: "
(apply 'strcat (mapcar 'car l))))

 

If anyone can help I'd greatly appreciate it!

Thanks in advance.

0 Likes
Accepted solutions (1)
287 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant

That someone certainly won't help you. You might wonder why.

0 Likes
Message 3 of 4

Sea-Haven
Mentor
Mentor
Accepted solution

An example for you

(setq l '("layout1" "layout2" "layout3"))

(setq str (nth 0 l))
(setq x 1)
(repeat (- (length l) 1)
  (setq str (strcat str "," (nth x l)))
  (setq x (1+ x))
)

(alert (strcat "\nBlock is located in layout: \n" str))
0 Likes
Message 4 of 4

jr_olmos23
Enthusiast
Enthusiast

Thanks! It adds a comma at the very end, but that's small potatoes.

0 Likes