Sweep Performance?

I’m trying to model underground pipes by following a topo surface at a specified depth. The basic workflow is:

  1. Divide pipe run into segments at an interval (e.g. 20-ft segments for individual pipe lengths)

  2. Project the segments to a surface and then drop down vertically to account for pipe cover (e.g. 4 feet to top of pipe)

  3. Sweep a circle along the path to create a solid using Curve.SweepAsSolid

This works OK for short distances, but I’m trying to do this for a ~1300’ pipe run and the script gets hung up every time and I have to force quit. Any ideas that I could try to improve performance?

I would use Rhino/Grasshopper, its more far more powerful than Revit / Dynamo in respect to geometry, its faster, has much better geometry engine, and it scales well on large projects.

That is good to know. Unfortunately I don’t think that will fit with our workflows because we need to utilize Dynamo in Civil 3D. The scripts are used by several users and need to be repeatable without having to learn others tools. But I appreciate your suggestion.

If you can try to mock your data or save it to disk and open it with DynamoSandbox 2.5 or greater there were some improvements to geometry memory management made there which might help out.

1 Like

I’d use Revit pipe objects rather than a sweep of a circle.
Or possibly an adaptive family- I did a tunnel something like 20km long with this method- in the order of tens of thousands of circular segments

Hi @mzjensen

You can track the time taken for each node to execute and replace that node with another node/function. This will help you know which node is causing delay. Hope that helps!

Yeah that’s a good thought. The ultimate goal is to create solids in Civil 3D by running the script in Dynamo Player, so I was trying to avoid the extra step of using Revit.

How can I track the time? Is there a package that I can get?

@Paolo_Emilio_Serra1 have you encountered something like this before?

Use Clockwork Package node Time.EvaluateTime and Time.LapTime.

Thanks everyone for the responses. The best solution that I found was to break the polycurve into individual line segments and run the sweep along each of those. This results in separate solids for each pipe length, which performs much better. Previously I was trying to create a single sweep over the entire 1300-ft length, which was too much for it to handle.

hmm, it sounds like this might have to do with poly curves, maybe less with sweep - if you have time to file a github issue with samples that reproduce it simpy, we can test it out against some performance improvements for polycurve.

1 Like