AddField Method (ScheduleFieldType, ElementId)


Adds a regular field at the end of the list.

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

Syntax

C#
public ScheduleField AddField(
	ScheduleFieldType fieldType,
	ElementId parameterId
)
Visual Basic
Public Function AddField ( _
	fieldType As ScheduleFieldType, _
	parameterId As ElementId _
) As ScheduleField
Visual C++
public:
ScheduleField^ AddField(
	ScheduleFieldType fieldType, 
	ElementId^ parameterId
)

Parameters

fieldType
Type: Autodesk.Revit.DBScheduleFieldType
The type of data displayed by the field.
parameterId
Type: Autodesk.Revit.DBElementId
The ID of the parameter displayed by the field.

Return Value

The new field.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration
Autodesk.Revit.ExceptionsArgumentsInconsistentException The field specified by fieldType and parameterId may not included in this ScheduleDefinition. -or- The field specified by fieldType and parameterId is already included in this ScheduleDefinition.

See Also