ChangeTypeId Method


Changes the type of the subelement.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.0.0.420)
Since: 2018

Syntax

C#
public void ChangeTypeId(
	ElementId typeId
)
Visual Basic
Public Sub ChangeTypeId ( _
	typeId As ElementId _
)
Visual C++
public:
void ChangeTypeId(
	ElementId^ typeId
)

Parameters

typeId
Type: Autodesk.Revit.DB ElementId
Identifier of the type to assign to this subelement.

Remarks

In rare cases, applying a change in type will result in a new element being created. The only active examples of this are when:
  • Applying a normal wall type to a curtain panel.
  • Converting such a wall back to a curtain panel.
  • Applying a new type to a railing subelement.
In this situation this subelement object will be redirected to the new element.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The type typeId is not valid for this subelement.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException This Subelement cannot have type assigned.
Autodesk.Revit.Exceptions ModificationForbiddenException This Subelement is an internal element, such as a component of a loaded family or a group type. -or- The document containing this Subelement is in Group Edit Mode, Sketch Edit Mode, or Paste Mode, and the element is not a member of the group, sketch, or clipboard. -or- This Subelement is a member of a group or sketch, and the document is not currently editing the group or sketch.

See Also