CreateElectricalLoadAreas Method


Creates electrical load areas on all the empty plan circuits of the given level.

Namespace: Autodesk.Revit.DB.Electrical
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Since: 2023

Syntax

C#
public static ISet<ElementId> CreateElectricalLoadAreas(
	Document doc,
	ElementId levelId,
	ElementId phaseId
)
Visual Basic
Public Shared Function CreateElectricalLoadAreas ( _
	doc As Document, _
	levelId As ElementId, _
	phaseId As ElementId _
) As ISet(Of ElementId)
Visual C++
public:
static ISet<ElementId^>^ CreateElectricalLoadAreas(
	Document^ doc, 
	ElementId^ levelId, 
	ElementId^ phaseId
)

Parameters

doc
Type: Autodesk.Revit.DB Document
The document where the created electrical load areas are.
levelId
Type: Autodesk.Revit.DB ElementId
The base level on which the created electrical load areas exist.
phaseId
Type: Autodesk.Revit.DB ElementId
The associated phase in which the created electrical load areas exist.

Return Value

The created electrical load areas.

Remarks

Use the HasCircuitsWithoutElectricalLoadAreas to check whether there are empty plan circuits in which there are no electrical load areas, if there are empty plan circuits, this API will create electrical load areas on each of them, otherwise, it will create nothing. In most cases, the electrical load areas will be created, updated and deleted automatically, but in some cases, there are some empty plan circuits and need to create electrical load areas on each of them.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException doc is not a project document. -or- The ElementId levelId is not a Level. -or- The id does not represent a valid phase.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).
Autodesk.Revit.Exceptions ModificationForbiddenException The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.
Autodesk.Revit.Exceptions ModificationOutsideTransactionException The document has no open transaction.

See Also