Generating Cable Tray Length Based on Volumes/Scope Boxes in Revit using Bimorph Nodes and Python Scripting

I have a request to output the length of cable trays based on the volumes or scope boxes that the cable trays are crossing. These volumes are represented as generic models. To achieve this, I used the solid from these volumes and cable tray curves, and then intersected the solid and curve to obtain the desired data.

I utilized a custom package from Bimorph nodes, and this approach worked for a sample project. However, when I tried this approach on a larger project with 3000 volumes and 6000 cable trays, it did not work.

Therefore, I am considering moving this code to Python and optimizing it for memory usage within the code. Alternatively, I may need to try a different method to obtain this data.
Any suggestions are welcome.

I couldn’t upload the Revit file so I have uploaded screenshot here.