Speeding up dynamo


So I’m running my script, but this takes about 2+ hours. So I was wondering how you can make it faster without upgrading you pc and cutting the estimated end result.

So I’m looking in the direction of certain setting inside dynamo or my pc

Thanks in advance

@remco.dejong ,

We modify our scripts in usefull “tasks”.

f.e. you could run the script per view or per Level …

I work in civil3d, not revit (its also marked with civil3D). I already filtered it down to two lists of objects but I don’t know if I can make it any faster, because its quite annoying to wait for 2 hours or more.

What you can/cannot do to speed things up will depend on what your script is actually doing. Have a look at the package called TuneUp, so you can concentrate on the areas of higher times to refine them.

If using geometry make sure you do this as late as possible in your script, and do not continue passing it along when not needed

Utilise Python instead of OOTB nodes may gain some time savings and of course dispose of everything when not needed.

So you can concentrate on the areas of higher times to refine them<
What do you mean with that?

The other things are pretty straight forward, I don’t use OOTB nodes in this file. I suppose it is just too heavy slicing 200 solids with 28 different cut lines.

I will look into that package later on.

The tuneup package will let you know where the file is slow, as each node’s execution time will be identified. This way you won’t spend six hours addressing something which can only make you 3 seconds faster, but instead focus on the area which can have impact.

My guess is that there is some manor of cross product lacing at play on the 200 solids, creating 200*28 solids to deal with when in memory, resulting in a lack of RAM for the process.

As Jacob has indicated it is so you can concentrate on the areas that will give you the best benefit. Eg something that could save 10 minutes over something that may save you 1millisecond.

How are you doing the Slicing? Is this done via Civil 3d api or Dynamo because sometimes doing it in python as native Civil 3d api might be quicker than using Dynamo api in Python.

Reducing the amount of geometric objects can also help run time.

I would highlight that Civil 3d is generally a single threaded application.

Maybe it has something to do with the bindings in the saved script. We always clear this part of the script after saving it, as otherwise some scripts take way longer without this step. For this task I created two co-op scripts as powershell and batch:

If you want to try it first: Just open the .dyn file in editor and search for “bindings”. Everything between the following pair of brackets “[…]” has to be deletet: ‘[ ]’. Then save the .dyn file.

1 Like

the slicing is being done with planes, because there is no other way to slice solids

Seems that:

  1. Solids are inconsistent. It happens in C3d
  2. Or too many unneeded intersections persists.
    Can you share files?