Dynamo remove points from list

hello everyone,
i want to test if the abcissa of my points are inferior to 1 or not and then delete those who does not satisfy the condition from the list of points
can anyone help me please

Hi,
you can simply use a code block to check the condition and use the results as a mask for List.FilterByBooleanMask:

2 Likes

thank you lucamanzoni

it works if i have one condition on the abcissa. however i have 3 conditions on x and 2 on y
for the positive x it needs to be superior to 0.935
for the negative x it needs to be between -0.45 and -3.015
i have also another 2 conditions on y
that’s why i wanted to write the code inside the code block because i find it difficult to elaborate with nodes

i tried point.x and point.y but i didn’t work :frowning:

connect them in series of condition and filterbyboolmask. That should achieve what you want

1 Like

instead of point.x and point.y what should i write in the code block ?

Something like this in your codeblock

x1 = DSCore.List.FilterByBoolMask(x,(x>0.935))["in"]
x2 = DSCore.List.FilterByBoolMask(x1,(-x1>0.45))["in"]
x3 = DSCore.List.FilterByBoolMask(x2,(-x2>3.015))["in"]
y1 = DSCore.List.FilterByBoolMask(y,(y>0.935))["in"]
y2 = DSCore.List.FilterByBoolMask(y1,(-y1>0.935))["in"]

final output should be at line of x3 and y2

1 Like

You can use AND and OR operators, in DesignScript they are written as && and ||

This is just an example, up to you to find the correct logic

2 Likes

FYI node to code is useful… if you use an X rather than x you’ll get the x coordinate…

Hope that helps,

Mark

1 Like