How to Filter only Element IDs with no Material


#1

Dear friends
As a part of a quality check, I want to list the IDs of those elements which have not Material in the model. I extracted the Material and IDs of all elements and did some filtering as shown in the below picture. At the end, I used List.Transpose to show me the IDs which have no Material, but the list also contains the IDs which have Material too. Would you please tell me how I can filter only the IDs which have no Material (as highlighted in the pic) from the list ?
I am gonna send only the list of IDs which have no Material to Excel, not all the IDs.

Thank you so much in advance


#2

Use RemoveIfNot node.


#3

Thanks @Kulkul for your response
I used it as shown in the pic but It doesn’t work and I do not exactly know I used it correctly or not.
Do you know where the problem is?
Thanks


#4

Since your ids are at index [1] list.LastItem will do the job here:


#5

Thanks @Kulkul

The List.LastItem as shown in your pic gives all IDs, but what should I do If I want to only get the IDs which do not have any assigned Material as shown below?

Thanks


#6

Actually, I don’t think you want to create the couples Material-ID in the first place… I think you should get the all the indices of the empty string (given that thos blank elements are indeed empty strings) in the original Material List (with the List.AllIndicesOf node), and then get the IDs at the corresponding indices in the ID list.


#7

Thanks @mellouze

I could get the indices of the empty string from the Material list using List.AllIndicesOf node, But could you please tell me how I can get the IDs at the corresponding indices in the ID list?

Thank you so much in advance


#8

List.GetItemAtIndex :wink: