Changes the type of all elements in the given set.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
C#
public static IDictionary<ElementId, ElementId> ChangeTypeId( Document document, ICollection<ElementId> elementIds, ElementId typeId )
Parameters
- document Document
- The document.
- elementIds ICollection<ElementId>
- A collection of element IDs.
- typeId ElementId
- Identifier of the type to assign to this element.
Return Value
IDictionary<ElementId, ElementId>The map of original element IDs to the new element IDs if some elements were replaced by new elements (the map is empty if no elements were replaced)
Exceptions
Exception | Condition |
---|---|
ArgumentException | At least one of the elements in elementIds does not exist in the document -or- Not all elements elementIds can have a type assigned. -or- The type typeId is not valid for at least one of the elements in elementIds. |
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | One or more elements in elementIds is a member of a loaded family. -or- One or more elements in elementIds is a member of a group type that is not being edited. |