Dear Dhiraj,
Here is what I have heard back so far:
1. For flipping Structural Framing elements we use StructuralFramingUtils::flipEnds(). As I browsed code very quickly, it don’t have any excludings (except material) so it should work for every FamilyInstance (probably that is bad). This is not nice solution but I would give a try and check if StructuralFramingUtils::flipEnds() works. Flip for Structural Framing means “swap ends => exchange beginning with end”.
2 I think this question is more about the general family instance transform than MEP things, I am afraid I am not the best one to answer it , but here is some comments to my best knowledge:
2.1. FamilyInstance.rotate() is a flip operation actually, it will work only if FamilyInstance.CanRotate==True; e.g, when you select the family instance, some kinds of flip control should be shown. For the coupling the video, obviously, there is no such control after selection, so the FamilyInstance.rotate() wont’t work for it.
2.2. I think flip operation is just a kind of mirror operation, the difference is that, user can specify the axis for mirror while the axis for flip is computed. Not all Revit family instances can be mirrored or flipped; but all family instance should be able to be generally rotated.
I hope this helps.
Please let us know how it goes and how you end up solving this.
Thank you!
Cheers,
Jeremy