Hi
One of the
DB.Plumbing.Pipe.Create
overloads allows putting the sytemTypeId in: http://www.revitapidocs.com/2017/9550265f-5760-3c28-d023-d0373285855b.htm
You'll need to find a pipe system type with the appropriate MEPSystemClassification to use for the elementId.
I'd recommend using Revit Lookup on an existing pipe with the same types that you want, and hard coding some of the element IDs in to test you get what you want before you proceed to using filteredelementcollectors to find each component/type. Take note of what exceptions you get (if any), and look at the link above to analyse the error.
-Matt