User MEP Calculation error

User MEP Calculation error

tamsann
Enthusiast Enthusiast
3,191 Views
16 Replies
Message 1 of 17

User MEP Calculation error

tamsann
Enthusiast
Enthusiast

Hello everyone

 

I am researching User MEP calculation, and when I tried to run the program, I encountered some errors:

 

  1. Error: "FormatUtils doesn't exist in the current context."
  2. Error: "CS1061 'Selection' does not contain a definition for 'Elements' and no accessible extension method 'Elements' accepting a first argument of type 'Selection' could be found (are you missing a using directive or an assembly reference?)"

 Could someone with experience in fixing these errors please help me? I'm new to this and would greatly appreciate your assistance.1.jpg2.jpg

0 Likes
Accepted solutions (2)
3,192 Views
16 Replies
Replies (16)
Message 2 of 17

sragan
Collaborator
Collaborator
Accepted solution

Formatutils is an obsolete command that "Formats a number with units into a string based on the units formatting settings for a document."

 

You will have to find another way to do this.

 

FormatUtils Members (revitapidocs.com)

 

 

Message 3 of 17

tamsann
Enthusiast
Enthusiast

Thank a lot for your help. I think I need to spend more time to study about this project.

0 Likes
Message 4 of 17

reylorente1
Collaborator
Collaborator
Accepted solution

Hola,aqui te dejo UserMepCalculation2024,no obtante, el Revit SDK 2024,tiene un Complemento(Addin) llamado NetworkPressureLossReport, que te puede servir tambien.

Espero que te ayude,y suerte

Hello, here I leave you UserMepCalculation2024, however, the Revit SDK 2024 has a Complement (Addin) called NetworkPressureLossReport, which can also be useful for you.

I hope it helps you, and good luck

Message 5 of 17

tamsann
Enthusiast
Enthusiast

Hello @reylorente1 , Thank you very much for sharing. It's helping me a lot.

0 Likes
Message 6 of 17

jeremy_tammik
Alumni
Alumni

I am in the process of editing this thread for a blog post. I found three existing related blog posts:

  

  

The third of these is especially interesting:

  

Revit MEP Calculation

  

The second example is a Revit MEP calculation external service sample for a pressure drop calculation. 

   

It was implemented specifically for this AU class and, as mentioned, uses external commands to add and remove the calculator. A proper calculator will be implemented as an ExternalDBApplication with no external commands involved.

   

It currently just demonstrates the principles and returns hardcoded dummy calculation results.

 
Handout and Class Material

 

The two sample applications discussed above are included in the zip file containing the SD10752 class material sd10752_revit_external_services_arnost_lobel_samples.zip.

 

Jeremy's note to self: the Revit 2014 UserMepCalculation sample is now superseded by this one and should be replaced:

  

  

Has any MEP expert here in the forum ever made use of Arnošt's updated sample? 

  

Does it have any useful enhancements over the UserMepCalculation sample we discussed?

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 7 of 17

jeremy_tammik
Alumni
Alumni

Thank you again for this, @reylorente1 !

  

Edited and shared on the blog:

  

https://thebuildingcoder.typepad.com/blog/2023/07/docs-lookup-mep-calculation-and-aps-devcon.html#6

  

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 8 of 17

jcrios_462
Participant
Participant

Hola @reylorente1 podrías ayudarme a instalar UserMepCalculation2024, tu ayuda será de gran utilidad. Muchas gracias.

0 Likes
Message 9 of 17

reylorente1
Collaborator
Collaborator

Si, si existe una manera más rápida, realmente no lo sé, pero aquí va como lo hago:

1 descarga el UserMep2024
2.Lo abro en .sln
3.Después de abierto, lo compilo
4.Después abro el ADDin y ve la ruta de mis archivos. cómo puedes ver yo cree una carpeta f, después ves vs, y después puse la carpeta en esa ruta C:\f\vs\UserMepCalculation (Esta ruta es creada por mí, pero puedes cambiarlas, siempre y cuando cambie la ruta en el ADDIN
5.Después tome el ADDIN y lo guarde en C:\ProgramData\Autodesk\Revit\Addins\2024 o también lo puedes guardar en C:\Users\reylo\AppData\Roaming\Autodesk\Revit\Addins\2024
6.Abres el Revit 2024, y debe aparecer esto, como aparece en la imagen siguienteCaptura de pantalla 2024-01-04 145235.pngCaptura de pantalla 2024-01-04 145309.pngCaptura de pantalla 2024-01-04 145333.pngCaptura de pantalla 2024-01-04 145356.png

Después ve a la pestaña System o sistema y toca la Mechanical Setting y en Calculation, aparece la pestaña PessureDrop , en Calculation Method, cámbialo por "User Pipe Pressure Drop" y en Flow por "User Plumbing Fixture Flow."

 

Espero que te ayude. Si tienes algún problema, no dudes en preguntar,

Message 10 of 17

jcrios_462
Participant
Participant

Hola @reylorente1 , luego de preguntar, seguí intentanto y logré realizar la instalación, aunque a la hora de compilar obtuve errores en "PressureLossReport", por lo que me ví obligado a eliminarlo, pues no tengo conocimiento del tema para resolver los mismos.

 

A continuación comparto una captura de los errores arrojados.

jcrios_462_0-1704424389264.png

 

Gracias por el paso a paso para la instalación, está muy completo y seguro ayudará a muchos más.

0 Likes
Message 11 of 17

reylorente1
Collaborator
Collaborator

Me parece que estas instalando el UserMep en un revit anterior (puede ser 2023 por ejemplo), ya que estos BuiltInParameter son del Revit 2024.Te recomiendo que revises con el RevitLooup, a ver que te dice el parametro, por ejemplo, el de la fricción de la tubería. No obstante, puedes usar el que trae por defecto, es mucho más completo el reporte

Message 12 of 17

john_mojicaP3U6X
Observer
Observer

Hola @reylorente1. Muchas gracias por la guía de instalación del UserMepCalculation, me fue de mucha utilidad, llevaba bastante tiempo buscando ayuda sobre el tema. Tengo revit 2023, cambié los buitlinparameter y otro par de cosas más y me compilo sin errores. Ajusté el PlumbingFixtureFlowServer cambiando y ajustando los valores de unidades de consumo y sus respectivos caudales de acuerdo a la normativa de mi país y los cálculos se ajustaron correctamente, sin embargo, al momento de generar el reporte  me aparece el siguiente error:

john_mojicaP3U6X_0-1729820381940.png

¿sabes como podría solucionarlo?

0 Likes
Message 13 of 17

reylorente1
Collaborator
Collaborator

Hola,si el error que presenta es que no tienes el fichero PressureLossReport
se fichero estas en tu máquina o tu Laptop:
buscalo en estas ruta:
C:\Program Files\Autodesk\Revit 2025\AddIns\MEPCalculation\o copia y lo pega :
aqui,dentro de los ficheros:


Captura de pantalla 2024-10-25 180120.png

Debe funcionar

0 Likes
Message 14 of 17

john_mojicaP3U6X
Observer
Observer

Hola @reylorente1 
Intenté lo que me indicaste pero aún así el error continua apareciendo. También le cambié el nombre al archivo .xslt a "UserPressureLossReport". Según el mensaje de error, parece que este archivo no se encuentra directamente dentro de la carpeta de UserMepCalculation sino que está dentro de otra:

john_mojicaP3U6X_0-1730248338210.png

¿sabes que podría estar pasando?

0 Likes
Message 15 of 17

reylorente1
Collaborator
Collaborator

Revisa en el GeneralsReport,revisa el metodo,HtmlStreamWriter:

public HtmlStreamWriter()
{
try
{
xmlFileName = System.IO.Path.GetDirectoryName( PressureLossReportHelper.instance.Doc.Application.RecordingJournalFilename );
if( xmlFileName != null && xmlFileName.Length > 0 )
xmlFileName = xmlFileName + "\\UserPressureLossReport" + DateTime.Now.Millisecond.ToString() + ".xml";

string strPath = typeof( UserPressureLossReport.WholeReportSettingsDlg ).Assembly.Location;
xsltFileName = Path.Combine(
Path.GetDirectoryName( Path.GetDirectoryName( strPath ) ),
"output", "UserPressureLossReport.xslt" );
//xmlFileName = strPath + "\\UserPressureLossReport" + DateTime.Now.Millisecond.ToString() + ".xml";
//xsltFileName = strPath + "\\UserPressureLossReport.xslt";
xmlWriter = XmlWriter.Create( xmlFileName );
}
catch
{
File.Delete( xmlFileName );
}
}
Este fue el cambio que hice, creo que lo que estas dentro // es lo que trae el programa y ese fue el cambio por el de arriba:
string strPath = typeof( UserPressureLossReport.WholeReportSettingsDlg ).Assembly.Location;
xsltFileName = Path.Combine(
Path.GetDirectoryName( Path.GetDirectoryName( strPath ) ),
"output", "UserPressureLossReport.xslt" );



0 Likes
Message 16 of 17

reylorente1
Collaborator
Collaborator
tambien puedes quitar el "output" y ponerlo directo,algoa asi:
public HtmlStreamWriter()
{
try
{
xmlFileName = Path.GetDirectoryName(PressureLossReportHelper.instance.Doc.Application.RecordingJournalFilename);
if (xmlFileName != null && xmlFileName.Length > 0)
{
xmlFileName = xmlFileName + "\\PressureLossReport" + DateTime.Now.Millisecond + ".xml";
}
string location = typeof(WholeReportSettingsDlg).Assembly.Location;
location = Path.GetDirectoryName(location);
xsltFileName = location + "\\"UserPressureLossReport.xslt";
xmlWriter = XmlWriter.Create(xmlFileName);
}
catch
{
File.Delete(xmlFileName);
}
},Mira ver si te funciona asi
0 Likes
Message 17 of 17

john_mojicaP3U6X
Observer
Observer

Hola @reylorente1 
Muchas gracias por tu colaboración. Antes de hacer cualquier cambio en los archivos, cree una carpeta llamada "output" y coloqué el archivo "UserPressureLossReport", ya con esto el reporte sale correctamente.

john_mojicaP3U6X_0-1730336479778.pngjohn_mojicaP3U6X_1-1730336511997.png


Muchas gracias por tu valiosa ayuda. Realmente esto me va ahorrar muchísimo tiempo para desarrollar los cálculos. Mi siguiente objetivo es intentar crear scripts para calcular otro tipo de redes que tenemos en las edificaciones, por ejemplo, redes de gas, desagües de aguas lluvias y residuales, etc.

0 Likes