Message 1 of 36

Not applicable
10-15-2020
12:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can I create a list that concatenates text and an item from a list?
(defun LM:changevis (lst1 lst2 / idx lst obj sel vis )
(setq lst
'( ;i know i need to remove this ' so that i can evaluate below
strcat("\"PANEL SIZE\" . \" (nth 1 lst2)) ;SET 2nd ITEM OF lst 1 to 2nd item of lst2
("BOM1" . (nth 2 lst2)) ;SET 3rd ITEM OF lst 1 to 3rd item of lst2
("BOM2" . (nth 3 lst2)) ;SET 4th ITEM OF lst 1 to 4th item of lst2
)
)
Alternatively, if i can loop thru each item in ls1 and create a list ("lst1 item 2" . "lst2 item 2") that would be better. The original code looked like this:
(defun LM:changevis ( / idx lst obj sel vis )
(setq lst
'(
("BOM1" . "ITEM1")
("BOM2" . "ITEM2")
("BOM3" . "ITEM3")
)
)
I was hoping to take it and pass 2 lists (lst1 lst2) and rewrite the section of code for concatenating the strings to be the values of the lists instead. I'm sure there's a way to loop this, but i'm more of a vba guy.
Solved! Go to Solution.