Create Method


Creates a new instance of a PipeSegment and adds it to the document.

Namespace: Autodesk.Revit.DB.Plumbing
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2013

Syntax

C#
public static PipeSegment Create(
	Document ADocument,
	ElementId MaterialId,
	ElementId ScheduleId,
	ICollection<MEPSize> sizeSet
)
Visual Basic
Public Shared Function Create ( _
	ADocument As Document, _
	MaterialId As ElementId, _
	ScheduleId As ElementId, _
	sizeSet As ICollection(Of MEPSize) _
) As PipeSegment
Visual C++
public:
static PipeSegment^ Create(
	Document^ ADocument, 
	ElementId^ MaterialId, 
	ElementId^ ScheduleId, 
	ICollection<MEPSize^>^ sizeSet
)

Parameters

ADocument
Type: Autodesk.Revit.DBDocument
The document where the PipeSegment will be created and added.
MaterialId
Type: Autodesk.Revit.DBElementId
The ElementId of the MaterialElem of the pipe segment.
ScheduleId
Type: Autodesk.Revit.DBElementId
The ElementId of the PipeScheduleType of the pipe segment.
sizeSet
Type: System.Collections.GenericICollectionMEPSize
A set of one or more sizes.

Return Value

The newly created pipe segment element.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The size list is empty. -or- The MaterialId and ScheduleId was already used by another pipe segment. Please use a new Material, a new Schedule/Type, or both.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsDisabledDisciplineException None of the following disciplines is enabled: Mechanical Electrical Piping.

See Also