Dear Sascha,
I closed the ADN case. I just use it as a container for our discussion here in this thread. Whether it is open or closed makes no difference as long as we are aware of its existence and case number. All communication can take place via this thread. I hope that clarifies.
I discussed this with the development team, and they say:
You can provide the pipe system type as an argument to the Pipe.Create method:
Sample code:
private List<PipingSystemType> m_pipingSystemTypes;
private List<PipeType> m_pipeTypes;
m_pipingSystemTypes = GetElements<PipingSystemType>().ToList();
m_pipeTypes = GetElements<PipeType>().ToList();
Pipe pipe = Pipe.Create(RevitDoc, m_pipingSystemTypes[i].Id, m_pipeTypes[j].Id, ...);
Also, the other two Pipe.Create methods take the connector as the input and automatically take the system type from the connector:
static Autodesk::Revit::DB::Plumbing::Pipe ^Create(Autodesk::Revit::DB::Document ^document, Autodesk::Revit::DB::ElementId ^pipeTypeId, Autodesk::Revit::DB::ElementId ^levelId, Autodesk::Revit::DB::Connector ^startConnector, Autodesk::Revit::DB::XYZ ^endPoint);
static Autodesk::Revit::DB::Plumbing::Pipe ^Create(Autodesk::Revit::DB::Document ^document, Autodesk::Revit::DB::ElementId ^pipeTypeId, Autodesk::Revit::DB::ElementId ^levelId, Autodesk::Revit::DB::Connector ^startConnector, Autodesk::Revit::DB::Connector ^endConnector);
As you noticed, the UI has a default system type as well as the default pipe type, even if the input does not include connectors.
That default value is saved in a SymbolIdMgr in the UI editor. Unfortunately, The SymbolIdMgr is not exposed in API.
That UI/API difference is similar for other non-MEP objects, like Wall objects.
There may be a problem with this second suggestion: the system (and thus the type) may not be assigned to the connector yet.
Maybe the first approach solves that and is already pointing to those?
Does that match your findings?
Cheers,
Jeremy