NewElectricalSystem Method (ICollection(ElementId), ElectricalSystemType)
Creates a new MEP Electrical System element from a set of electrical components.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 16.0.0.0 (16.0.0.0)

Syntax

C#
public ElectricalSystem NewElectricalSystem(
	ICollection<ElementId> electComponents,
	ElectricalSystemType elecSysType
)
Visual Basic
Public Function NewElectricalSystem ( _
	electComponents As ICollection(Of ElementId), _
	elecSysType As ElectricalSystemType _
) As ElectricalSystem
Visual C++
public:
ElectricalSystem^ NewElectricalSystem(
	ICollection<ElementId^>^ electComponents, 
	ElectricalSystemType elecSysType
)

Parameters

electComponents
Type: System.Collections.Generic..::..ICollection<(Of <(<'ElementId>)>)>
The electrical components in this system.
elecSysType
Type: Autodesk.Revit.DB.Electrical..::..ElectricalSystemType
The System Type of electrical system.

Return Value

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

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentNullException Thrown when the specified parameter Value is nullNothingnullptra null reference (Nothing in Visual Basic).
Autodesk.Revit.Exceptions..::..ArgumentOutOfRangeException Thrown when the elecSysType parameter Value is out of the range of ElectricalSystemType.
Autodesk.Revit.Exceptions..::..InvalidOperationException Thrown when the electrical system cannot be created by these input electrical components.

See Also