Dynamo Script speed


#1

I’ve made copies of the demonstration scripts that pull airflow values from spaces and write them to the flow parameters of air devices in the associated space.

The scripts work, but they take too long to run. I have a version that will perform this task for a single user selected room, and a version that will do it for the entire project. The multiple-space version crashes or takes 10s of minutes (haven’t let it run to completion on a larger project). The single space version takes about 30 seconds (on the current project i’m working on)

am i doing something very wrong that it takes so long to run?


#2

Quick thoughts

  1. Filter support air terminal before geometry intersect check since you only need only those.
  2. Alternative for geometry.intersect?

3 remove family.location…unused … Impact unsure


#3

Could you provide your dyn file and dummy Revit project?


#4

Dynamo and Revit use different geometry primitives and going from one to the other requires an expensive conversion. The two Element.Geometry nodes take up ~99% of the time. Do you really need the actual geometry in Dynamo? Why not do the checking directly in Revit?

image


#5

As Dimitar says, use these nodes. Space class has IsPointInSpace method http://www.revitapidocs.com/2017/33c97031-a9ad-00d0-4d4a-42522201d2db.htm
which is efficient.
One flaw is that you need to set up room calculation point in equipment correctly (for air terminals).
Is should take ~1min for 3k air terminals.
Or be lazy like me :smiley: and disable room bounding property from all ceilings in architecture model, so it won’t matter (ofc it depends whether you use spaces volumes etc…), so you don’t need to change calculation point.
Or third way, check bimorph nodes as they use built-in filters, so it should be way way faster:
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/Revit-API/files/GUID-2DE34D37-912E-475F-B3E0-BE40D88C8875-htm.html


#6

@Dimitar_Venkov I think i understand your suggestion, and i’m not doing anything with the actual geometry, i just need to determine where the air devices are and build the list of airflows. I guess the nodes you’ve referenced will check the geometry in revit, and not ‘bring it into’ Dynamo?

I’m trying the Clockwork:Element.Location+ node to get points representing the air terminals, and Space.IsPointInsideSpace, and getting some peculiar behavior. The ‘preview’ and values in the watch are different (see image below).

@Tomasz_Puchala i’m already disabling the room bounding property in ceilings, so i think this should work. I checked out the BimorphNodes package, and it looks like spaces aren’t a supported category for the Element.IntersectsElement node, otherwise, this looks like a really straightforward way to improve this task.


#7

I have found nodes in the DynamoMEP package: Space.IsInSpace and Space.FromElement, and these seem to work ok. Still trying to learn how to implement the clockwork timestamp nodes to better identify the speed of different nodes. The Rhythm node isn’t working for me, as I detailed above.

In my preliminary testing, it almost seems like the script slows down when writing the parameters. Right now the modified script can identify which air devices are in which space, and takes about 20s to run on my model with ~300 spaces. But it stops responding when i connect the list of terminals and values to the Element.SetParameterByName node. I’m going to test the single space version with timestamps and see how long it takes to complete.


#8

@m.clough Regarding the timestamp nodes, have a look at this sample file:
https://raw.githubusercontent.com/andydandy74/ClockworkForDynamo/master/package_samples/1.x/dynamo/Core.Time.dyn