Surface.Difference with Null

I want to use the surface.difference node to subtract surface areas. It works great however, sometimes I do not have a surface to subtract (null). Is there any way for the surface.difference to still spit out the surface.bypatch surfaces with the null value for others. See snip. I did think about creating a dummy surface to subtract when the value is null but I was wondering if there was a better way. Thanks.


Basin Area_v2.dyn (109.5 KB)

Look into the Function.Apply node as it can suppress the warning here. However you will still get null from that node, so you’ll want to create a list of the the differenced surface list and the original surface list, transpose the results, and then get the first item from each sublist.

Thanks Jacob. I did with what you said and it worked! Another question, can a run dynamo player with nothing selected? Is there a work around?
image

Not with the out of the box tools. You could trigger a datashapes UI++ node to enable selection if a Boolean input is set to true.

Jacob. My hatches and tables are sometimes disappearing. Do you know the reason why? It seems to only happen with the sidewalk and road layers. Thanks.

Basin Area_v2.dyn (135.9 KB)
Final Drainage Impervious Exhibit.dwg (6.4 MB)

Sounds like element binding. Search element binding in civil 3D as there is a good post by @mzjensen that I can’t find at the moment (on my phone). It should help you square things away, or confirm binding is not part of the problem.

Might be wrong but wasn’t the binding setting introduced in 2023? Related to the first screenshot the nodes seems to be from earlier versions than that but I might be wrong.

Older builds also had bindings, but without the settings to control the behavior.

1 Like

Correct, my bad.
You read my mind so that I didn’t had to write them :smiley:

1 Like