I have a list of vectors and I am trying to filter out the “Z” values to only contain values between 0.1 and 1. Once I have a list, I need to match these up to the original Vectors to get a new list containing only the Vectors between 0.1 and 1.
I don’t have much python experience but this is what I have tried so far:
I also tried to run nested if loops to test if Z was bigger than 0.1 and if Z was less than 1, but that just returns the entire original list I fed into Python.
I know this can be done without Python but I am trying to get better at it. If someone could help me with this I would really appreciate it.
Thank you so much, I tried the “and” before, but i missed the ‘else’ I think that is why it wasn’t working
It actually still isn’t working, but I think that is most likely because I have to import additional references?? But that is not important for now, I just wanted the correct syntax for the function.
Thanks very much for your time and effort Daan
It is possible that you need to import Revit and Dynamo into your Python. that is done like this:
*Note: I am not 100% sure that you need all of this. Maybe you can drop some lines
I have a hunch that it has to do with my list structure in the p.Z code block where I have 3 levels, I assume I have to account for that somewhere in the code maybe, as the Python is outputting 2 levels only?
The list.flatten > python method does work, so it’s definitely a list management issue inside the Python node… I will look around and see if I can figure this out, but you have done more than enough to help, really appreciate it