DirectShape to show Cable Tray clearance

I am new to Dynamo and looking to create a script for my office that will add a modelled clearance above and to either side of all cable trays in the model. The clearance should be 300mm from the surface of the cable tray. I have these two options that I found online.

This one creates the DirectShape as a single solid which will be critical in allowing our modellers to delete the old clearance and regenerate it when cable trays have changed. It also keeps to the shape of bends in the cable tray since it is copying the geometry 1:1. However, it only makes the clearance as extend as far as the height of the cable tray.

This one essentially extrudes the DirectShape directly from the surfaces of the cable tray.

I think the best solution would be to raise the generic model in the first example by half the desired clearance and then expand it up and down by the required amount to reach back to the cable tray. Then, apply the same logic for the sides. Is this the best way to do this? I’m not sure how to do it. Any help would be immensely appreciated.

That’s because it’s using the Height of the cable tray. You can make it whatever height you want.

The simplest shape is going to be your best bet. You don’t need to match the exact shape for clearances as you really only care about covering the extremes. Just because you can technically place something without intersecting a clear space doesn’t mean you should and will likely complicate things anyway.

1 Like

I’m sorry, I don’t understand what you’re saying. I understand that I’m using the greatest height of the cable tray as the distance to translate the geometry on the z axis, and I just realized that to adjust that distance I need to modify it before it inputs to the Geometry.Translate node’s distance, but I’m not sure how to go about modifying the geometry to extend its height. The resulting clearance solid needs to encompass the full space of the clearance so that our mechanical guys can use it for clash detection.

It should be as simple as Height + Clearance = Height + 300m. In fact, this is the best way to create a clearance object. Get the dimensions of your cable tray (width x height) and add double your clearance to both. Then you can extrude that profile along the cable tray path.

If I do it that way, the clearance solid will overlap the cable tray, though. If my coworkers run a collision check, it will show every cable tray overlapping the clearance, which I guarantee will be confusing for people. That’s why I like this method of creating clearances and moving them to where they need to be. Unless there is a way to subtract the geometry of the cable tray from the resultant solid?

I have added the Solid.DifferenceAll node to subtract the geometry of the cable trays from the new solid before creating the DirectShape. As shown, the geometry is being correctly cut, but the DirectShape is receiving a null value from Solid.DifferenceAll. I don’t understand what is going wrong here?

Tried it with Geometry.Split, but same problem.

Make sure you’re posting screenshots with node preview bubbles pinned. Otherwise all we can see is the outcome.

This is where it’s best to keep things simple. Get the cable tray geometry and convert it to a single solid or polysurface. Expand that solid to create the clearance solid. Then remove the original geometry from the clearance solid to be left with just the clear space.