# Split Geometry At a given length

So. I want to split the conduits of my project to automatically insert a union fitting after three meters
I already filtered it by type and by length. The last thing for me to do is to split it at the given length
Any Tips?
Thank you all in advanceSplit Conduits By Length.dyn (10.1 KB)

Thank you!

From what I can read splitting conduit isnâ€™t accessible via the API so you have to recreate the conduit.

Get the location line, split the line into parts with a gap To allow the union, and delete the old one. Then create new ones for each line in the list. The union may or may not place automatically (not a conduit or MEP systems guru), if not try using the line endpoints to place one.

1 Like

here you goâ€¦
ConduitByLength.dyn (20.6 KB)

same solution as for

5 Likes

Two birds with one graph! Nice one @erfajo!

@JacobSmall
Almost same question, 99.9% same answer

Many questions asked is very similar to each other. New problems are rare. This problem is not that far from dividing curves into segments and do something with that. In this Case was copying new elements the â€śthingâ€ť. I was surprised that there isnt a OOTB node for copying elements.

Another thing that was weird was that there is not a split family instance node. unfortunately do I not have the time for now to code such a node, but I think @john_pierson has a point in his post Split Beam at model line

2 Likes

Well, Thank you for your support
it did exactly what i needed it to do, however it was not the solution.
There is no union fitting in the splitted region.

What i thought it would do was inserting the union fitting automaticallyâ€¦ But it seems i was wrongâ€¦

Tot add to @erfajoâ€™s post: you could try using this on the newly created curves:

2 Likes

If the fitting by curves doesnâ€™t work as is, try adding a gapbetween the ducts - the previous code split the lines consistently at 3 units. You need breaks at something like 2.99 and 3 (3 and 3.01 may also work) for a connector to automatically join the system (if it even will). To do this I would subtract 0.01 units from the break sequence which was built (specifically the 0â€¦1â€¦step codeblock).

Note that you will have to remove the last curve for the upper input and remove the first curve for the lower one in order for the fitting by curves node to work.

If someone should be interested, then is here the solution for splitting conduits into segments and adding couplings as joints.
ConduitByLengthUnion.dyn (38.3 KB)

For alternative solution see here
-> Divide a duct to a length not greater than 3.92 ft

2 Likes

Wellâ€¦ Thank you for your routine
But unfortunately it doesnâ€™t work properly.
See what happens.
But iâ€™ll have to thank you for your unconditional support!

@ramoon.bandeira
Try to use this solution thenâ€¦ It used @T_Pover node â€śMEPFitting.ByMEPCurvesâ€ť

ConduitByLengthUnionConnected.dyn (35.0 KB)

5 Likes

That worked perfectly!
Thank you @erfajo

9 posts were split to a new topic: Element.CopyByVector custom node