Create Method (Document, IList(ElementId), ElectricalSystemType)


Creates a new MEP Electrical System element from a set of electrical components.

Namespace: Autodesk.Revit.DB.Electrical
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2018

Syntax

C#
public static ElectricalSystem Create(
	Document document,
	IList<ElementId> electComponents,
	ElectricalSystemType elecSysType
)
Visual Basic
Public Shared Function Create ( _
	document As Document, _
	electComponents As IList(Of ElementId), _
	elecSysType As ElectricalSystemType _
) As ElectricalSystem
Visual C++
public:
static ElectricalSystem^ Create(
	Document^ document, 
	IList<ElementId^>^ electComponents, 
	ElectricalSystemType elecSysType
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The Document.
electComponents
Type: System.Collections.GenericIListElementId
The electrical components in this system.
elecSysType
Type: Autodesk.Revit.DB.ElectricalElectricalSystemType
The System Type of electrical system.

Return Value

If successful a new MEP Electrical System element within the project, otherwise a null reference (Nothing in Visual Basic).

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException There should be at least one component that can create the specified circuit type
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration
Autodesk.Revit.ExceptionsDisabledDisciplineException None of the following disciplines is enabled: Mechanical Electrical Piping.

See Also