Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.

Revit API Forum

Reply
Post 1 of 24

UserMEP Calculation Addin

685 Views, 23 Replies
04-17-2014 08:54 AM

I've followed the article in the following link http://thebuildingcoder.typepad.com/blog/2013/07/user-mep-calculation-sample.html , built and installed the addin and came up with the error messages below:







The DLL's and the addin are in the "Addins" folder along with the default MEPCalculation folder.

Any input would be greatly appreciated.

Post 2 of 24

Re: UserMEP Calculation Addin

04-17-2014 09:23 AM in reply to: deubanks7525
You have apparently succeeded in getting the .dll file and .addin file in the right locations and your addin is loaded into Revit, but has run into a problem. Click on the "Show details" button. It tells you more precisely what went wrong. Post again if you can't understand it. BTW, we've all been here.
Post 3 of 24

Re: UserMEP Calculation Addin

04-17-2014 09:28 AM in reply to: peterjegan

Here are the same errors expanded:






Post 4 of 24

Re: UserMEP Calculation Addin

04-17-2014 11:39 AM in reply to: deubanks7525

I looks like the addin is failing when it tries to add a server that is defined in your addin, but not quite correctly.

 

I am not familiar with this addin, but I would wonder if there are some settings you are missing, perhaps pointing to a lookup table or ?

 

Is there a portion of the code that points to a network location that you need to adjust?

 

Also, I see that in the original Building Coder project, there is a "PostBuild.bat" file. Did you run it, or get any errors running it?

Post 5 of 24

Re: UserMEP Calculation Addin

04-17-2014 12:42 PM in reply to: peterjegan

From what the article says, the files should be built and installed as is?

I simply changed the file path in the .addin file to the "Addins" folder. Is there something I'm missing or is this much more involved than it looks?

I need editable source code to troubleshoot fixture unit-to-flow conversions mainly.

I ran the "PostBuld.bat" file and got something similar for each server folder. This "PostBuild.bat" file is from UserMepCalculation\StraightSegmentCalculationServers\Bin\:


Post 6 of 24

Re: UserMEP Calculation Addin

04-20-2014 06:50 AM in reply to: deubanks7525
It does not look like there is a problem with the addin per se or its location as it seems it can be loaded and executed (the exceptions is raised during the addin’s handling an OnStart call).
 
What it looks like instead is a problem with an instance of an External Server trying to register with an External Service while the service does not recognize the given server as the type of a server it expects to get. (too long a sentence? ;-)
 
Example: Say there is a registered external service, give it a name SpecialMEPCumputationService, which delegates its work to an external server via interface class ISpecialMEPComputationServer. Typically, there would be a default server class in Revit (inherited from the ISpecialMEPComputationServer interface) which would be used for those calculations, but 3rd parties can register their own servers that may do the calculations differently. To do so, a 3rd party programmer implements a class (say, MyMEPComputationServer) inheriting from the ISpecialMEPComputationServer. It must implement this particular interface, otherwise the service would not accept it to be registered for that service; meaning: it would thrown the exception that was mentioned in the previous posts in this thread.
 
Note: Sometimes the a service fails to recognize its server even when the server is inherited from the correct interface. I’ve seen it happen in special cases, for example when the addin applications was spread over multiple DLLs with classes being inherited across those DLLs. I am not saying that is the case here; I am just mentioning it as another possible cause of the external server-registration failure.
 
Arnošt Löbel
Sr. Principal Engineer
Autodesk, Revit R&D 
Arnošt Löbel
Post 7 of 24

Re: UserMEP Calculation Addin

04-21-2014 06:19 AM in reply to: arnostlobel

Thank you for your response. I updated the paths of the .dll files referenced in the .addin file. I built the .dll files and placed them on a network drive and placed the .addin file in Revit's addin folder. However, I noticed there were two (2) addin file locations. I changed the path of the .addin file to be located here:


C:\Users\deubanks\AppData\Roaming\Autodesk\Revit\Addins\2014


I originally had it located here:

C:\Program Files\Autodesk\Revit 2014\AddIns

Once I made that change and had the paths of the .dll files corrected in the .addin file, Revit loaded with no errors.

I now have "User defined" MEPCalculation options for Duct Pressure Drop, Pipe Pressure drop, and Plumbing Fixture Flow.

I also solved the small fixture unit to flow conversion problem that I had previously with predominantly flush valve supply systems. The default software code written to convert "Fixture Units (FU)" to "Flow (GPM)" via Hunter’s Curve didin't account for fixture units below 5FU for "Predominantly
Flush Valve Supply Systems." It assumed 15.0 GPM for anything  ≤5FU for “Predominantly Flush Valve Supply Systems” and assumed 3.0 GPM
for anything  ≤1FU for “Predominantly Flush Tank Supply Systems.”

I updated the source code and added fixture unit values all the way down to 0.25FU for both flush valve and flush tank supply systems. Now Revit will size pipe appropriately. Of course the conversions are subjective below what the 2012 IPC offers. However, now they can be changed anytime. I used the conversions below because they produce the appropriately sized pipe via the duct/pipe sizing tool.







Post 8 of 24

Re: UserMEP Calculation Addin

04-21-2014 11:52 PM in reply to: deubanks7525

Dear Deubanks7525,

Thank you for your query, research and solution.

I am very glad to hear that you got it resolved.

I am sorry that this add-in is a bit more convoluted and harder to understand than most.

It qwas apparently extracted from the main Revit source code, and still has some unnecessary and unusual admin bagage attached.

Did you clone your source from the GitHub repository?

https://github.com/jeremytammik/UserMepCalculation

Could you provide the fixes that you applied, please, so we could integrate those into the master repository there, in case they are of use to others as well?

Thank you!

Best regards,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Post 9 of 24

Re: UserMEP Calculation Addin

04-22-2014 01:40 PM in reply to: jeremytammik

jeremytammik,

Thank you for your response. Yes, I adopted the extracted source code from the link I provided in the original post.

 I made a few changes to the code to adjust plumbing fixture flow calculations. I added Fixture Unit-to-Flow Rate conversion on the "Predominantly Flush Valve” supply system.

When branch mains are sized that have small fixture unit, flush tank loads (1-4 FU), they take on “predominantly flush tank” characteristics. However, they can still be part of the larger “predominantly flush valve” supply system.

In this case, the branch main pipe serving the small fixture unit, flush tank fixture(s) will be sized using the “predominantly flush tank” guidelines, per IPC. 


A supply system in Revit is mutually exclusive in regards to this topic. Supply systems must be one of the two options.

I believe the solution is to extend the “predominantly flush valve” supply system, incorporating values from
1 FU – 4,000 FU for correct Flow Rate conversions, and ultimately correctly sized pipe.

Now Revit will not assume 15GPM for Fixture Unit values ≤5FU for “Predominantly Flush Valve “supply systems.


Post 10 of 24

Re: UserMEP Calculation Addin

04-24-2014 08:21 AM in reply to: jeremytammik

jeremytammik,

 

PipePressureDrop is currently using the length of pipe and friction to calculate pressure loss. However, it does not take into account pressure loss due to elevation. Below is the default method for pressure drop calculation from source code:

 


Total pressure loss must include pressure loss due to elevation. To do this, we must include the normal offset difference of the pipe segment and multiply that by the pressure drop per elevation offset difference. Below is how the pressure drop would ideally be calculated in source code.







Currently all variables being used for calculations are referencing class Autodesk.Revit.DB.Plumbing.PipePressureDropData.

StartOffset and EndfOffset are referenced in class Autodesk.Revit.DB.Extrusion.




How do we use dDeltaOffset within public void Calculate(PipePressureDropData data)?

Post 11 of 24

Re: UserMEP Calculation Addin

04-29-2014 12:47 AM in reply to: deubanks7525

Dear Deubanks7525,

 

Thank you for your update.

 

I don't really know how to help you further.

 

Have you made any progress yourself?

 

Would you like to provide the source code as text instead of screen shots, so we can take a closer look at it?

 

Better still would be to provide a reproducible case, c.f.

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Post 12 of 24

Re: UserMEP Calculation Addin

04-29-2014 12:59 AM in reply to: jeremytammik

I see that you raised a new thread for this question:

 

http://forums.autodesk.com/t5/Revit-API/Adding-elevation-loss-to-Pipe-Pressure-Drop-calculation-usin...

 

Let us continue the discussion there, then.

 

Thank you.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Post 13 of 24

Re: UserMEP Calculation Addin

02-28-2016 11:26 PM in reply to: deubanks7525

Hello,

 

to everybody. I'm MEP engineer from Croatia and I work in firm which is Autodesk Gold Partner. We work in Autodesk Revit our projects, BIM implementation, trainings and we also are developing tools for simpler use of Revit. Currently we have developed addin for Domestic Water Systems. This addin adds new calculation method for Plumbing Fixtures using FU. Calculation method is based on DIN 1988-W308 norm, also we have added the elevation loss calculation through addin. Applications can calculate critical path based on line pressure loss in pipes and elevation loss.

 

You can find our application on Autodesk Exchange.

 

https://apps.autodesk.com/RVT/en/Detail/Index?id=appstore.exchange.autodesk.com%3awatersystemcalcula...

 

Best Regards

Post 14 of 24

Re: UserMEP Calculation Addin

03-01-2016 02:56 AM in reply to: D.Svigir

Dear D.Svigir,

 

Please note that this discussion forum is dedicated to programming Revit using the Revit API.

 

Therefore, your information about the availability of your commercial end user product is not completely appropriate, unless you want to help the Revit add-in developer community by pointing out and explaining certain interesting technical aspects of its internal implementation.

 

I hope this clarifies.

 

Thank you for your understanding.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Post 15 of 24

Re: UserMEP Calculation Addin

03-15-2017 08:49 AM in reply to: jeremytammik

Hello, can someone help me with this?

I wrote a post here https://forums.autodesk.com/t5/revit-mep-forum/pipe-annalysis-revit-pipe-sizing-flow-gpm/m-p/6947775...

 

I am trying to fix my issue of The default software code written to convert "Fixture Units (FU)" to "Flow (GPM)" via Hunter’s Curve does not account for fixture units below 5FU for "Predominantly Flush Valve Supply Systems." It currently assumes 15.0 GPM for anything  ≤5FU for “Predominantly Flush Valve Supply Systems”

 

I see Deubanks7525 fix, however I do not know how to get there to change what he is talking about.

Post 16 of 24

Re: UserMEP Calculation Addin

03-15-2017 09:19 AM in reply to: apoindexter

I got this on My C drive and added these. However its still not working in revit.

Post 17 of 24

Re: UserMEP Calculation Addin

03-15-2017 12:11 PM in reply to: apoindexter

Oh hey, check that out....

 

  1. Download the addin, and open it in visual studio.
  2. Edit the values as you have done.
  3. Compile the addin
  4. Save the .addin file to the addins folder and edit the .addin file to point to the compiled .dll
  5. Open Revit, goto Manage -> MEP Settings -> Mechanical Settings -> Pipe Settings -> Calculation. Click in the "Flow" tab and change the "Calculation Method" drop down to "User Plumbing Fixture Flow".

I just tested it in 2017 and it works great.

Post 18 of 24

Re: UserMEP Calculation Addin

03-15-2017 01:24 PM in reply to: mwilson1

Can someone explain the fix as to why for the Flush Valve System we are imputing the flush tank values in?

1- 3gpm

2- 5gpm

3- 6.5 gpm

4 - 8gpm

 

see attached.

Post 19 of 24

Re: UserMEP Calculation Addin

03-15-2017 03:05 PM in reply to: mwilson1

mwilson1 ,, can you give me the final .addin and .dll files because it didn't work with me.

Post 20 of 24

Re: UserMEP Calculation Addin

03-16-2017 03:32 AM in reply to: IslamSakr

The development team replies:

 

Looks like the changes for the user to change the behaviour is in this file:

 

https://github.com/jeremytammik/UserMepCalculation/blob/master/StraightSegmentCalculationServers/Pip...

 

In fact, the post from "04-22-2014 03:40 PM in reply to: jeremytammik" includes a screenshot showing the developer modifying the ‘table’ of values below 5 fixture units.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post

Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.