Trimming curves(lines) by elements(surfaces, boundingboxs or solids)

How do I cut the parts of lines(Red highlighted) which cross the elements?
I tried with Curve.Solidintersection, but only worked for first lines. I also tried to change lacing but still couldn’t get the correct result.
And the first line, which is cut also a bit weird. I placed structural framing on the lines(the lines length is okay) but there are gaps between the elements. To reach my goals which nodes do I need to use?

Hola Amigo @jaeho Geometry.Intersect Works fine I think, but maybe you have to clean the list or fix Levels, hope this gives you some ideas.

you can manage to find your points of intersection
Determine the relative distances (of each point of intersection) compared to the total distance of your line of Section L (D1/L, D2/L,…)

then use the trim segment with these same parameters

(afterwards I don’t know with the roundings…)


It doesn’t work for me…

@jaeho Amigo, you are comparing full lines vs solids, frankly it seems very strange that the node does not work, it is made precisely for that, what do you think @christian.stan ?

1 Like

I followed your way by using the Geometry. Intersect node (same nodes, levels and lacing) but the result is different…
Did I put any inputs wrong?

Amigo @jaeho You don’t seem to have put anything wrong, you even have a result, can you share your file to look at it carefully? if possible of course! what version of revit are you using?

Thank you for your checking!
Sorry, the file is related to my work. so I can not share it;
I’m using Revit 2020.2.5 and Dynamo 2.3.1

you can try following this approach

16 aoutforum anglais.dyn (69.0 KB)



Hi, Thank you for your approach.

Unfourtunately, I couldn’t understand that which nodes that I can connect my lines to be trimmed.

and What does the number slider work for?

1 Like

In fact, I project the line on a surface with voids, so no lines at the places of the voids (the result)

the front part of the script is an essay of resembling geometry (“which approximates± your geometry”)

Thank you for your explanation.

In your picture, I could see that you selected 65th value from Topology.Faces,is there any reasons for that?

1 Like

As screenshot 2 (I took this one as the largest and lowest surface)

edit: more or less manual lazy way
(Else: if complete approach:
Vector whose surface normal is almost equal to the component vector (0,0,-1))

1 Like

Wow. You made me go home from my office today!.
Thank you so much!

1 Like