Skip to content

Entity.Clear(String)

Public Class

Resets the field to its default value.

Namespace: Autodesk.Revit.DB.ExtensibleStorage

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public void Clear(
string fieldName
)

Parameters

fieldNameString

The name of the field to clear.

Exceptions

Exception

Condition


ArgumentException

The name matches no field in this Entity’s Schema. -or- This field’s subschema prevents writing.


ArgumentNullException

A non-optional argument was null


InvalidOperationException

This Entity is invalid.


Remarks

The default value is zero for numeric fields, invalid value for identifiers and entities, and empty for strings and containers. This method is a shortcut that will look up the field by name. If you want to call it on many entities, it is faster if you look up the field yourself.