Skip to content

MEPNetworkIterator

Public Class

An iterator to traverse the MEP analytical network.

Inheritance Hierarchy

System.Object
Autodesk.Revit.DB.Analysis.MEPNetworkIterator

Namespace: Autodesk.Revit.DB.Analysis

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public class MEPNetworkIterator : IDisposable

The MEPNetworkIterator type exposes the following members.

Constructors

Name

Description


Public Method
MEPNetworkIterator(Document, MEPAnalyticalSegment)

Creates an iterator to visit the connected segments on both sides.


Public Method
MEPNetworkIterator(Document, MEPAnalyticalModelData, ConnectorDomainType)

Creates an iterator by the analytical model data to visit all connected components in the network.


Public Method
MEPNetworkIterator(Document, MEPAnalyticalNode, MEPAnalyticalSegment)

Creates an iterator to visit the connected segments on one side of the network.


Properties

Name

Description


Public Property

The element id at the current iteration step.


Public Property
IsValidObject

Specifies whether the .NET object represents a valid Revit entity.


Public Property

The optional MEP system classification where the iterations are restricted.


Public Property

The optional MEP system element id where the iterations are restricted.


Methods

Name

Description


Public Method

Releases all resources used by the MEPNetworkIterator


Public Method

Checks if the network iteration has completed.


Public Method

Equals

Determines whether the specified object is equal to the current object.
(Inherited from Object)


Public Method

Gets the analytical model data at the current iteration step.


Public Method

Gets the analytical node at the current iteration step.


Public Method

Gets the analytical segment at the current iteration step.


Public Method

GetHashCode

Serves as the default hash function.
(Inherited from Object)


Public Method

Gets the other analytical node at the current iteration step.


Public Method

GetType

Gets the Type of the current instance.
(Inherited from Object)


Public Method

Moves this iterator to the next step of network iteration.


Public Method
Start

Gets the first step of network iteration.


Public Method

ToString

Returns a string that represents the current object.
(Inherited from Object)


Remarks

The iterator will visit the entire MEP analytical network in the depth-first order. For evert next step, one analytical node and one analytical segment are typically visited. Sometimes an extra node is provided if the iteration reaches the end on one side and restarts at the previous intersect node. Also note that the start step may not contain any segment.

Example

// Create a new MEPNetworkIterator to traverse a piping network in the depth-first order.
int segmentCount = 0;
MEPNetworkIterator netIter = new MEPNetworkIterator(doc, modelData, ConnectorDomainType.Piping);
for(netIter.Start(); !netIter.End(); netIter.Next())
{
MEPAnalyticalSegment segment = netIter.GetAnalyticalSegment();
if (segment != null)
segmentCount++;
}