Air Terminal on Rectangular Duct MEPOver

Hi there,
I’m a newbie in Revit MEP and I’m trying to place a Air Terminal on a Rectangular shaped Duct.
I run into this old post in the forum and I wonder if any improvements had been made on Revit API methods / MEPover package.

My goal is to create ducts and air terminals from CAD file, and I succeded.
The script somehow fails with the node Duct.ConnectAirTerminalOnDuct by MEPover package.

I attach a few screenshots to better show what I accomplished so far.
Thanks in advance for your kind reply.



Eventually I’ll try to make ducts connection work better (by placing tees and elbows) and place air ducts on vertical faces of the ducts.

Thanks in advance for your kind attention and reply.

P.

1 Like

Not entirely sure I understand the issue, but this method in the API might get you started: ConnectAirTerminalOnDuct Method

1 Like

Thanks for the reply Jacob.
You nailed it, the method is exactly the one used in MEPover node I used.
What puzzles me is that at the end of the script I get the error of the picture I posted and such air terminal is not created. When I check individually the air terminals created I find most of them set attached to the duct (icon on the ribbon) while at least one appears not to be connected (you can see it also by the annotation symbol in plan view).

The position of all air terminals points in my CAD is exactly on the ducts lines so I don’t seem to get why this odd behaviour happens when I run the script.

Hard to see exactly why one element is failing without the graph and a minimal reproducible data set (ie: make three ducts and 6 terminals, where one terminal doesn’t attach). Can you post such?

Hi Jacob, sure.
Please find at this link the CAD file, the Revit file and the Dyn script.
Thank again for your time and help.

P.

You’re trying to match 15 air terminals without any structure. The there is no functional chance that the duct locations and sequences will be perfectly aligned to the terminal locations and sequence. Whenever the terminal’s location point doesn’t fall on the duct’s centerline, you’re going to get a failure message As such you’re going to have to do some geometry comparison to ensure thing A is associated to thing B correctly.

  1. make the ducts as you were before.
  2. Get the duct location - a bunch of lines.
  3. Get the distance from each point to each duct using a Geometry.DistanceTo node. Watch your lacing (longest) and list levesls (@L2 for the duct location curves, @L1 for the terminal location points.
  4. Sort the ducts by the distances, using a List.SortByKey node with @L2 for both inputs and longest lacing. You should have a list of N sublists containing M items for a total of N*M items, where N is the number of terminals and M is the number of ducts.
  5. Pull the First item out of each sublist with a List.FirstItem node set to @L2 for the input. You now have the right duct for each terminal location point, but there is no certainty that the terminal points fell on the duct curves…
  6. As an added check, pull the terminal points onto the duct curves using a Geometry.ClosestPointTo node, where the geometry input is the terminal points, and the other input is the location of the sorted ducts.
  7. Generate the family instance by these points.
  8. Connect the families to the duct.

Watch out for ElementBindings, which are going to trip you up as you author stuff like this if you aren’t careful. Once you get the graph built, clear the bindings (I have a post on my admin account showing how to do so - search Element Binding in Revit) and from that point on only run without saving or via Dynamo Player to ensure they don’t get stuck in there.

1 Like

Thanks a lot Jacob for your time and throughly explanation!
I’ll try to follow your step by step guide and get back to you hopefully with the working script.
Thank you for giving me the chance to test my fishing ability (improving and correcting my script) and not handing me the fish already “cooked” (the working script) :sweat_smile:

Have a nice day.
P.

2 Likes