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.
Solved! Go to Solution.
Solved by jeremytammik. Go to 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
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.
Thank you for sharing your results. They make perfect sense, of course. Preserved here for posterity:
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”.