- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm having trouble creating pipe placeholders in Revit. The function always returns an error stating 'The systemTypeId is not a valid piping system type.' I've tried using all possible system types, but the issue persists. Can someone assist me?
My code so far:
//
ElementId levelId = view.LevelId as ElementId;
//
FilteredElementCollector collector = new FilteredElementCollector(document)
.OfClass(typeof(MEPSystem));
ElementId sysId = null;
foreach (MEPSystem syselement in collector)
{
ElementId sysId1 = syselement.Id as ElementId;
Boolean teste = Pipe.IsPipingSystemTypeId(document, sysId1);
if (teste == true)
{
sysId = sysId1;
}
}
//MEPSystem systemType = collector.FirstElement() as MEPSystem;
//SEGMENT TYPE
FilteredElementCollector collector2 = new FilteredElementCollector(document)
.OfClass(typeof(PipeSegment));
PipeSegment pipeType = collector2.FirstElement() as PipeSegment;
//
LocationCurve c = element.Location as LocationCurve;
XYZ start = c.Curve.GetEndPoint(0);
XYZ end = c.Curve.GetEndPoint(1);
Curve beamLine = Line.CreateBound(start, end);
//
Pipe placeholder = Pipe.CreatePlaceholder(doc, sysId, pipeType.Id, levelId, start, end);
return placeholder;
Solved! Go to Solution.