Duplicate Method


Duplicates an existing element type and assigns it a new name.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)

Syntax

C#
public ElementType Duplicate(
	string name
)
Visual Basic
Public Function Duplicate ( _
	name As String _
) As ElementType
Visual C++
public:
ElementType^ Duplicate(
	String^ name
)

Parameters

name
Type: SystemString
The new name of the element type.

Return Value

The duplicated element type.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException name is an empty string. -or- name cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~". -or- The element type name was empty, contained invalid characters, or was invalid for the specific element type. -or- The name is already in use for this element type.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsInternalException Duplicate element type could not be obtained.
Autodesk.Revit.ExceptionsInvalidOperationException The ElementType cannot be copied.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →