GetAssociatedParts Method (Document, LinkElementId, Boolean, Boolean)


Returns all Parts that are associated with the given element

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

Syntax

C#
public static ICollection<ElementId> GetAssociatedParts(
	Document hostDocument,
	LinkElementId hostOrLinkElementId,
	bool includePartsWithAssociatedParts,
	bool includeAllChildren
)
Visual Basic
Public Shared Function GetAssociatedParts ( _
	hostDocument As Document, _
	hostOrLinkElementId As LinkElementId, _
	includePartsWithAssociatedParts As Boolean, _
	includeAllChildren As Boolean _
) As ICollection(Of ElementId)
Visual C++
public:
static ICollection<ElementId^>^ GetAssociatedParts(
	Document^ hostDocument, 
	LinkElementId^ hostOrLinkElementId, 
	bool includePartsWithAssociatedParts, 
	bool includeAllChildren
)

Parameters

hostDocument
Type: Autodesk.Revit.DB Document
The document of the element
hostOrLinkElementId
Type: Autodesk.Revit.DB LinkElementId
The element to be checked for associated Parts.
includePartsWithAssociatedParts
Type: System Boolean
If true, include parts that have associated parts
includeAllChildren
Type: System Boolean
If true, return all associated Parts recursively for all children If false, only return immediate children

Return Value

Parts that are associated to the element

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL

See Also