ChangeTypeId Method


Changes the type of the subelement.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
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.DBElementId
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

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The type typeId is not valid for this subelement.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsInvalidOperationException This Subelement cannot have type assigned.
Autodesk.Revit.ExceptionsModificationForbiddenException 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