<Code Lib>
2025.3 Method
Changes 5
M

Document.GetAllUnusedElements

Description:
Returns the list of element ids that are not used. The list of unused element ids may include elements that can't be deleted.
Remarks:
This method returns unused element ids that are available in the Purge Unused window in the Revit, including elements that can't be deleted. To get unused elements that do not have a category assigned add INVALID to the collection of categories. If the input categories collection is empty, the method returns all unused elements in the document.

public ISet<ElementId> GetAllUnusedElements(
	ISet<ElementId> categories
)

  • ISet<ElementId>
    categories
    Collection of categories to check for unused elements.
Return Value ISet<ElementId> ISet ElementId

Loading…