Avoid operations on Null items after Sift

Null items usually aren’t affected by operations, but in case of addition they are, since A+Null is still A i guess. I think i have the same problem with Dispatch, but also i prefer to use the Sift function so i can hold on to my Null items to keep the list structure.

Is there a faster or better way to do this other then testing for Null item to be true and Dispatching/Sifting the other item?

I was looking at making my own addition function in Python, but i couldn’t figure it out. Something like:

if y == None: a = None / else: a = x+y

The point is, you have nulls. That’s the start of the problem.
What you want to do when a null occours?

You can Replace Nulls with a generic text, making any math component returns an error instead of computing…

I gathered that Nulls are a part of using Sift and Combine in combination with eachother. The Nulls act as placeholder items until you combine the lists together, thereby keeping the list structure. (Combine is not shown in the image above)

Replacing Nulls for text might be an ok workaround. Thanks.

Info on Combine says:
Combine non-null items out of several inputs

So i hope my usage of this component is correct. I am no expert on sifting out data trees so if not, please let me know.

I noticed the Division function does maintain the null, so i might have found a decent workaround.

I usually go with dispatch and then weave…

Hard to tell more without seeing your actual data… and without an explanation of what/how/when you want to create those points at the end…

I see that works well for me too. Better then my workaround actually. Thanks!

I’m making a file for a client to produce technical drawings. Part of the interface is a set of panels where the client has some inputs to make a few holes, which are different for every drawing. The points for those holes can be staked out from a sideline or a centerline, so the numerical XY data for the points has to be processed differently, depending on the relation side/centerline. But i’ll also use this technique for differentiating between round and rectangular holes.

My problem is solved i think, but thought i’ll give the complete picture just in case. If you have more tips i’ll be glad to hear them.

Dispatch.gh (16.8 KB)

1 Like