List and sublists


#1

Hi all

I’m having a problem with my lists.

I am pulling warnings from multiple linked models and listing them according to the model name.
However, when I combine the lists, the model name only applies to the first 12 warnings, since there is only 12 models.

My question is, how do I add the correct model name to the related warning i field 0 i the list. I want to list the model name in front of all warnings when I export to Excel.

Thanks alot in advance.


#2

use count and repeated items


#3

Thank you @Marcel_Rijsmus. I tried to implement the nodes, but don’t get the proper function out of them. Perhaps I’m putting them in the wrong place. Could you elaborate?


#4

in the first node i create a single text (something)
in the second node i create an alphabetic sequence
in the list count node it counts how long my list is (18 items)
in the 4th node i repeat the outcome of the fist node 18 times.
so, count the number of warnings and repeat the name of the model x-times>>use list create and transpose to write in excel use list create more than once to create sublists
list create creates a list.
the result from that in a new list create node makes it a sublist


#5

@Marcel_Rijsmus I tried it, but it does not have the effect I want. See attached picture.

I want to add the correct model name to each warning. Now they just appear in the beginning of the list and the warnings appear after.


#6

i dont know how many linked models you have, can you tell me?
and remove the list at level in the count node please


#7

I have 9 models which I extract the data from.
I’v removed the list at level in the count, but it does not help.


#8

can you show me what you have now with all the previews


#9

Off cause. Thank you.

Below is a capture from the workspace with all previews
.


#11

Hello. This version of the python node should have the structure you wanted. Let me know if it needs changes:
linkedwarnings4
linkedwarning inc model.dyn (2.9 KB)


#12

That is absolutely brilliant. Thank you so much. This is extremely useful!

Will have to dive more into the API and Python!