Duct Sizing with the API

Duct Sizing with the API

jelliottCRA
Contributor Contributor
1,052 Views
1 Reply
Message 1 of 2

Duct Sizing with the API

jelliottCRA
Contributor
Contributor

I'm working on creating my own version of the duct sizing tool to add additional inputs and constraints beyond what the regular version can do. I believe I should be using the DuctPressureDropData class, but can't figure out how to actually use it. The description of the class lists several inputs and outputs that seem to be exactly what I need, but I can't find a constructor example or anything that shows how to assemble everything. 

 

Really what I'd like to do is iterate through a bunch of duct sizes, given a set of parameters to size with, and check the pressure drop of each size until I find the size that gives the correct pressure drop. Once I have that, assigning the values for height and width to the duct itself is straightforward.

 

Is there an example available somewhere? Thank you for your help, I'm a little lost.

0 Likes
1,053 Views
1 Reply
Reply (1)
Message 2 of 2

ollikat
Collaborator
Collaborator

Hi

Although I haven't used that particular class my self, I tried to figure out some hints for you:

 

So the DuctPressureDropData  class is a part of the "external service" provided by the Revit. The External Service Framework (ESF) is a Revit API concept providing a way to extend Revit internal services. The very basic idea is that the 3rd party developer creates a "server" for the service in order to provide customized functionality.

Following are the key items in the API:

ExternalServices.BuiltInExternalServices.DuctPressureDropService: This tells you the identifier for the calculation service
IDuctPressureDropServer: This is the interface you need to implement for the server
IDuctPressureDropServer.Calculate(): In the signature of this method, you actually can see the class you were talking about.

For some reason the API .chm wasn't able to find the relationship between the interface and the DuctPressureDropData class, so that's why you kind of needed to know what to search for.

One more thing. From here you can find quite comprehensive tutorial for the ESF, highly recomend you study that one first:
https://www.autodesk.com/autodesk-university/class/Revit-External-Services-Make-Built-Features-Behav...

Lastly, there was somewhat similar question already, but I'm afraid it doesn't help much:
https://forums.autodesk.com/t5/revit-api-forum/api-to-run-duct-sizing/td-p/8960819

 

Hope these help you to proceed.

0 Likes