List - get items that are not equal to another list

Hi everyone,
I have a list with 2 sublists and I want to get items that are not matching another with another list. But it this important to keep same list structure as original list.
What I get instead is that are 2 sublists being checked separately.


List - get items that does not equal.dyn (4.4 KB)

I do not have an easier answer…

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

OriginalList = IN[0]
search=IN[1]

result=[]
for x in OriginalList:
	temp1=[]
	for i in x:
		temp2=[]
		for s in search:
			if s!=i:
				temp2.append(True)
			else:
				temp2.append(False)
		a=all(p==True for p in temp2)		
		if a:
			temp1.append(True)
		else:
			temp1.append(False)
	result.append(temp1)
	
OUT = result
1 Like

Try using an AND function.

1 Like

@Julian_Krab An additional node along with altered levels and checkied boxes on nodes should get you the desired result


notEqual.dyn (4.3 KB)

4 Likes