Importing Pipes Revit Tirade
So, on creating the PIpeLoader for importing pipes, there are some tricky things to look out for. The goal was to draw pipes in Hypar that could then be imported into Revit to create a ContentCatalog of the desired connections. The pipes in the hypar function are offset so that they are bottom aligned.
Loading them into Revit, then connect them to create a transition, and one of the pipes has a slope now, when it should be flat.
Sure enough, looking in section there is a slope. but if you undo you can see that it looks like they are bottom aligned... Until you jiggle one of the ends, then they redraw as different sizes. This is shown in the gif below.
It turns out, we have two problems. Firstly they're not actually loading as the correct size at all!
Large size of first transition in Hypar, 50mm
Large size of first transition in Revit, 56mm
So, that's annoying. turns out there is a floating point issue where Revit has all it's internal sizes in Imperial, not metric, and when you set a pipe's Diameter it looks for the next largest size in it's list of allowed sizes, but if you have to convert from metric to feet you sometimes end up just above the desired size.
If you do a tiny downward fudge to the conversion in Hypar converter where the "Diameter" parameter is set, then you end up with the correct size drawn in Revit
Ok, so now it "works" but there is still this strange behavior on some of the pipes where a pipe's size is not correct until you jiggle it. This is not a breaking issue, but can cause confusion especially while debugging.
This may be related to pipe segment settings where the nominal diameter is different from the outside diameter, as in the settings image here. We have not conclusively resolved this issue, it is simply a quirk we've observed.