CreateMergedPart Method


Create a single merged part which represents the Parts specified by partsToMerge.

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

Syntax

C#
public static PartMaker CreateMergedPart(
	Document document,
	ICollection<ElementId> partIds
)
Visual Basic
Public Shared Function CreateMergedPart ( _
	document As Document, _
	partIds As ICollection(Of ElementId) _
) As PartMaker
Visual C++
public:
static PartMaker^ CreateMergedPart(
	Document^ document, 
	ICollection<ElementId^>^ partIds
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document.
partIds
Type: System.Collections.GenericICollectionElementId
The elements that the merged part will be created from.

Return Value

The newly created PartMaker. a null reference (Nothing in Visual Basic) if no parts are merged.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException One or more element ids was not suitable for merging with the others. Specified elements should all be Parts, report the same material, creation and demolition phases, and have contiguous geometry.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsInvalidOperationException 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.ExceptionsModificationForbiddenException 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.ExceptionsModificationOutsideTransactionException The document has no open transaction.

See Also