Sorry for the delay. I believe this should work. Make sure the reference alignment is set to an alignment along the pipe network or use “SetRefAlignment” on the pipes to switch it and then switch it back, to what is necessary, for the purpose of the script.
I’m sure there is a simpler way but this is my best first attempt
I think that he want the opposite of what you have thankfully done @WrightEngineering. He may want to set the invert of pipe network pipes to an already drawn and designed profile, like the pressure network pipe runs (you can draw layout profile and set it as reference profile for that pipe run).
Yes. I believe that is what the script will do. Perhaps I did not describe it properly. It will get the elevations of the profile and set the pipe invert elevations to match it at the matching station.