Nesting foreach isn't a problem. The problem is that you have quoted lists in the call to modelFile, and so these won't get evaluated.
Your call to modelFile should be:
modelFile(
list("/xx/xx/1.scs" device)
list("/xx/xx/2.scs" element)
)
There was no need to have the sprintf's in there - you can pass the variables directly. Quoted lists don't evaluate anything within the '(...), whereas the list() function evaluates all its arguments before creating the list.
Regards,
Andrew.
Originally posted in cdnusers.org by adbeckett