Duplicates an existing element type and assigns it a new name.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
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: System..::..String
The new name of the element type.
Return Value
The duplicated element type.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | name is an empty string. -or- name cannot include prohibited characters. -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.Exceptions..::..ArgumentNullException | A non-optional argument was NULL |
Autodesk.Revit.Exceptions..::..InternalException | Duplicate element type could not be obtained. |
Autodesk.Revit.Exceptions..::..InvalidOperationException | The ElementType cannot be copied. |