I presented on this on the community conversations. You have the video here: Go with the Flow in Dynamo - Community Conversations - YouTube
Scripts and dataset are on the thread here: Dynamo Office Hours
You can take a look at that. I am connecting the structures and pipes and applying elevations to them (albeit in a simplified way for demoing purposes).