How to get the value of the property "Loss Method"?

How to get the value of the property "Loss Method"?

Hanley.DengK8R83
Contributor Contributor
1,164 Views
4 Replies
Message 1 of 5

How to get the value of the property "Loss Method"?

Hanley.DengK8R83
Contributor
Contributor

There is the property "Loss Method" in a Pipe fitting, 

In UI, the value is "Use Definition on Type", but in API, the value is a GUID, "3bf616f9-6b98-4a21-80ff-da1120c8f6d6".

Then How can I convert the API value, "3bf616f9-6b98-4a21-80ff-da1120c8f6d6", into the UI value, "Use Definition on Type" ?

See the attachment "LossMethod.png"

Thanks a lot.

0 Likes
Accepted solutions (1)
1,165 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk
Accepted solution

The loss method can be programmed, so the GUID you see might be something like the add-in identifier:

 

https://thebuildingcoder.typepad.com/blog/2017/12/pipe-fitting-k-factor-archilab-and-installer.html

 

Best regards,

 

Jeremy

 

 



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

Message 3 of 5

Hanley.DengK8R83
Contributor
Contributor

Problem solved.

This problem is solved in 2 cases:

case 1: for Pipe fittings, when Loss Method is "Use definition on type".

             this case can be identified, if the parameter.AsString() equals to the GUID in Autodesk.Revit.DB.MEPCalculatationServerInfo.PipeUseDefinitionOnTypeGUID. 

            In this case, I cannot find the UI Display string for it, then I hard code the UI display string.

Case 2: when it is not case 1, including other value in Pipe Fittings, and all the value in Duct fittings, use the API:

Autodesk.Revit.DB.MEPCalculatationServerInfo.GetMEPCalculationServerInfo(objFamilyInstance), 

Then the ServerName is the string in UI Display.

Message 4 of 5

jeremytammik
Autodesk
Autodesk

Thank you for sharing your results. They make perfect sense, of course. Preserved here for posterity:

 

https://thebuildingcoder.typepad.com/blog/2019/05/generate-directshape-element-to-represent-room-vol...

 



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

Message 5 of 5

Hanley.DengK8R83
Contributor
Contributor

I find that if the Loss Method is "Use definition on type", then it actually means to use the Loss Method on Family Type.

As the picture show, in this case, Property “Loss Method” should be “K Coefficient from Table”.

 

0 Likes