Revit Slows down after large Dynamo script

Not ideal @Greg_McDowell
I’ll have a play around and see if I can offer some alternative solutions when I am back in the office on Monday.

I can’t give you any guarantee that it will help, but you could try the “RevitProcess.EmptyWorkingSet” from spring nodes. It will flush any non-critical memory from the active process to the swap file and hopefully spare you from a restart.

3 Likes

Has anyone who have experienced this issue taken a look at task manager after the slowdown begins?

The only time I’ve seen such a slow down is when the graph in question has created tons of data, or has touched so many elements in the Revit model, that the ram is completely used up (and then some).

The biggest reason for slowing down is the way the graph is created. The best way to solve this is to track time taken for each session by adding time.lapse and select 1 or 2 elements. Then try other workarounds to minimize the time where you see the time.lapse is giving you more. Hope it helps!

1 Like

@Kulkul if composition is the main issue, has anyone compiled anything (custom node, external script) that can perform an audit on a .dyn file?

Things like:

  1. Number of nodes
  2. Number of laces
  3. Number of functions upon completion of run
  4. Run time
  5. Node package dependencies

Having this kind of information available would mean you could assess where the “big script” issue starts to occur. Ultimately letting you decide how best to optimise your script (more coding, less lacing…) I’d be keen for something like that!

@Ewan_Opie I mostly use python for my workflows i will add time inside the python so that it helps understand where is the cause :slight_smile:

5 Likes

:+1:t2: top tip, thanks! @Kulkul

Hi All, sorry for late reply.

First of all, thanks All of you for your discussion here. Very pleased to know that the issue is more often than I thought. I agree with @Greg_McDowell that closing Revit is not the best solution for a not-workshared session.

@Kulkul and @Dimitar_Venkov, thanks for the suggestions. I’ll try both of your recommendations.

Last but not the least, I managed to make the script using speed preference (from fastest to slowest) scripting - recommended un some past thread:

  • Python
  • Design Script
  • Custom Nodes
  • OOTB and Package Nodes

For my scripts, I try to make the most of it in python. Also I’ll check the non-python parts to see if I can speed them up somehow.

Again, Thanks all of you or the discussion!

CHeers

Hi @Kulkul,

I’m trying to replicate your recommendation for a very simple python node:

I have some huge measurement units which I presume they are not seconds. How do you translate it into seconds?

Thanks in advance!

Time :slight_smile:
image

1 Like

Thanks!

I also manage to do this:

import time
tiempo = []

tiempo.append(time.time()) #several times (all needed)

tiempo_final = []
for t in range(1, len(tiempo)):
    tiempo_final.append(round(tiempo[t] - tiempo[t - 1], 4))

I had a couple of minutes spare (I know, when does that happen) so I put together an Audit node for .dyn files.
I intend to have this as part of my first package publish (a few weeks away yet) hence the node naming, so expect to see it there also (with some further optimization)

Audit DYN

Inputs/Options:

  • File Path (DYN)
  • Create Report (CSV file in the same folder as the script)

Outputs:

  • File Info (Name, Size, Workspace version)
  • Total Number of Connectors
  • Unique Node names, types and numbers of.
  • Script Composition (Node types, numbers of and total)

I am thinking when used in conjunction with time tracking shown by @Kulkul and here How to measure execution time for nodes? - #4 by Andreas_Dieckmann this may form a starting point for thoughts on how to optimize a script.

In case you are wondering "Sastrugi=parallel wave-like ridges caused by winds on the surface of hard snow, especially in polar regions."

EDIT/UPDATE: A revised version of this node can be found here, until I am able to publish my package.

5 Likes

OMG! NIce work @Ewan_Opie

@Ewan_Opie, I tried your node, but the output file is almost the same. COlumn structure is different. I have all the information in the column A of the CSV File.

Hmm not ideal, can you post a screenshot?


I managed to get it orginized as you have in your image, but I needed to import from text, not just open the CSV file.

How did you open the csv? Did you drag the file into excel? or open it using a double-click?
I am trying, and failing, to replecate this error… :thinking:

The first time, Double-CLick. The second imported from the Data ribbon.

Can you post your dyn?