Difference function - removing compared solids


Hi All,

I just started using Dynamo and I’m still trying to figure out how things work. As an experiment, I wanted to cut a sphere out of a cube. I first created two solids and then used Solid.Difference to ‘cut’ the sphere out of the cube. The function seems to work properly (I translated the result to show you what I’m after), but I can not seem to remove the original two solids. I am able to hide them (right click -> uncheck preview), but then they still show up when I export to STL. Is there a way to remove the two original solids from the model after using the difference function? Thanks in advance!

use the export to sat node -or use mesh toolkit package, then you can feed the resulting geometry into the node so you can export exactly what you want.

Thanks for that reply. The Mesh Toolkit package did the job perfectly.

I just tried the same, but with a series of spheres (see screenshot). When I use the difference function (and hide the spheres), the result is a solid cube. It seems that the function doesn’t work when used this way. Any advice?

You’ll need to use recursive code to achieve that. Here’s a quick example:

Flatten the list of spheres

Nice one, Vikram. I forgot about “Solid.DifferenceAll”.

Another unofficial trick, that I don’t really recommend, is to union all the spheres into a single disjoined solid :

Excellent! This is very helpful. Thanks.

Hi there, I am also having difficulty with solid difference. I tried both solid difference and solid difference all nodes. and niether one work. I tried every possible combination and I still cant get this to work. Even tried merging all the solids so I only have two solids but the solid by difference node keeps crapping out on me, what I have is two underground duct banks and I want to only take what is underground but the slab Is different heights, so I create a solid for all of it an unioned them together, now I just want to take the parts of the conduit duct banks that dont clash with the slap solid that I made. Any idea of what I am doing wrong?