How to map list of pipes to list of location lines after lines are re-organized to different list structure

MEP Fitting can only be created via MEP curves i.e. pipe / conduit / duct, i have a list of pipes, re-organize its location lines into different list structure, but how to replace those lines w/ original pipes, i tried ReplaceByCondition but not work well, did i miss something simple?

Edit: tried Geometry.AlmostEqual, plus Lacing, same result

What was the method used to restructure the geometry list? If it’s a key-based method, can you just use the keys to group the original pipe list?

not keys, i use group by function (line direction and curve length), you can see geometries in previous image

Assuming this is the same task shown and discussed in the other thread you had on ordering curves, your best bet is to pass in the pipes not the curves as the input of the ordering tool and return the pipes not the curves.

The alternative is a ‘intersects’ test with the base dataset’s curves and the midpoint of the sorted curves, which will lead to performance issues due to the poor memory use of the workflow.

1 Like

solved by flatten curve list first to match ReplaceByFunction structure and then sublists pipes

yes, same task, add fittings to multiple set of pipes instead of just one set of pipes, so pipes need to be sorted, do pipes have ordering tool?

perhaps you can expand that loveable Python tool to accommodate multiple set of curves instead of just one set of curves @ Sort 3D lines so they can be joined eventualluy - Revit - Dynamo

Working with multiple sets shouldn’t be too difficult, but it isn’t something I would want to take on here due to the inherent fragility of on canvas Python scripts. Moving to a custom node is the right solution for that.

However as your sorting existing pipes it is likely that the fittings exist and you should just collect those at the start; making your life more difficult by the repeated creation and sorting otherwise.