I am writing a script to place sleepers for 300 rail alignments. unfortunately some of the alignments do not have a profile and my list management gets messy. how can I replace empty lists with a dummy profile?
Hi @Reto,
You could use the List.Clean
node to remove the empty lists. Or List.IsEmpty
could be used to figure out which indices the empty lists are at, and then you could do something after that to replace the items at those indices.
Aside from that though, I’m curious how the rest of the graph will work if you’re using a dummy profile? Won’t the sleepers be at the wrong elevations?
Lastly, it looks like you may want to use Block.GetBlockByName
instead of Block.ByName
, which is used for creating new block definitions.
Thanks Zachri, if I clean the list of profiles how can I clean the list of CantInfoatStation the same way so they still match?