Merges the two regions which share the specified segment.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)

Syntax

C#
public int MergeRegionsAdjacentToSegment(
	int segmentId,
	int layerIdxForMergedRegion
)
Visual Basic
Public Function MergeRegionsAdjacentToSegment ( _
	segmentId As Integer, _
	layerIdxForMergedRegion As Integer _
) As Integer
Visual C++
public:
int MergeRegionsAdjacentToSegment(
	int segmentId, 
	int layerIdxForMergedRegion
)

Parameters

segmentId
Type: System..::..Int32
The id of a segment in the underlying grid.
layerIdxForMergedRegion
Type: System..::..Int32
The index of the layer to which the resulting region will be associated.

Return Value

The id of the resulting region. If -1 is returned, then the operation would have produced an invalid region and was not performed.

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentOutOfRangeException The layer index is out of range.
Autodesk.Revit.Exceptions..::..InvalidOperationException This operation is valid only for vertically compound structures. -or- The segment is not shared by adjacent regions.

See Also