SchemaBuilderAddMapField Method |
Creates a field containing an ordered key-value map in the Schema, with given name and
type of contained values.
Namespace: Autodesk.Revit.DB.ExtensibleStorageAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic FieldBuilder AddMapField(
string fieldName,
Type keyType,
Type valueType
)
Public Function AddMapField (
fieldName As String,
keyType As Type,
valueType As Type
) As FieldBuilder
public:
FieldBuilder^ AddMapField(
String^ fieldName,
Type^ keyType,
Type^ valueType
)
member AddMapField :
fieldName : string *
keyType : Type *
valueType : Type -> FieldBuilder
Parameters
- fieldName String
-
The name of the new field.
- keyType Type
-
The type of the keys for the new field.
- valueType Type
-
The type of the values for the new field.
Return Value
FieldBuilder
The FieldBuilder object may be used to add more details to the field. Make sure to set
the unit type if the field contains floating-point values.
Exceptions
Remarks
The supported types for the keys are Boolean, Byte, Int16, Int32, Int64, ElementId,
GUID and String. Floating-point types (Float, Double, XYZ and UV) are not supported
because round-off errors frequently cause numeric instability. Subentities are not
supported because they require a custom comparison operator. The suggested workarounds
are either placing key values into an Array and using array indices for keys, or
just using an Array of subentities.
Natural comparison of contained types is used for sorting.
The supported types for values are the same as for simple fields.
See
AddSimpleField(String, Type) for details.
Note that a schema may contain a maximum of 256 fields.
See Also