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: 2015.0.0.0 (2015.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.DB Document
The document where the PipeSegment will be created and added.
MaterialId
Type: Autodesk.Revit.DB ElementId
The ElementId of the MaterialElem of the pipe segment.
ScheduleId
Type: Autodesk.Revit.DB ElementId
The ElementId of the PipeScheduleType of the pipe segment.
sizeSet
Type: System.Collections.Generic ICollection MEPSize
A set of one or more sizes.

Return Value

The newly created pipe segment element.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException 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.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions DisabledDisciplineException None of the following disciplines is enabled: Mechanical Electrical Piping.

See Also