Definition File

Definition File

The DefinitionFile object represents a shared parameter file. The definition file is a common text file. Do not edit the definition file directly; instead, edit it using the UI or the API.

Definition File Format

The shared parameter definition file is a text file (.txt) with two blocks: GROUP and PARAM.

Code Region 22-1: Parameter definition file example

# This is a Revit shared parameter file.
# Do not edit manually.
*GROUP  ID      NAME
GROUP   1       MyGroup 
GROUP   2       AnotherGroup 
*PARAM GUID     NAME    DATATYPE        DATACATEGORY    GROUP   VISIBLE 
PARAM   4b217a6d-87d0-4e64-9bbc-42b69d37dda6    MyParam TEXT    1 1
PARAM   34b5cb95-a526-4406-806d-dae3e8c66fa9    Price   INTEGER 2 1 
PARAM   05569bb2-9488-4be4-ae21-b065f93f7dd6    areaTags        FAMILYTYPE -2005020 1 1
  • The GROUP block contains group entries that associate every parameter definition with a group. The following fields appear in the GROUP block:
    • ID - Uniquely identifies the group and associates the parameter definition with a group.
    • Name - The group name displayed in the UI.

      Figure 130: Edit Shared Parameters (Group and Parameter)

  • The PARAM block contains parameter definitions. The following fields appear in the PARAM block:
    • GUID - Identifies the parameter definition.
    • NAME - Parameter definition name.
    • DATATYPE - Parameter type. This field can be a common type (TEXT, INTEGER, etc.), structural type (FORCE, MOMENT, etc.) or common family type (Area Tags, etc). Common type and structural type parameters are specified in the text file directly (e.g.: TEXT, FORCE). If the value of the DATATYPE field is FAMILYTYPE, an extra number is added. For example, FAMILYTYPE followed by -2005020 represents Family type: Area Tags.

      Code Region 22-2: Shared Parameter FAMILYTYPE example

      FAMILYTYPE -2005020

      Figure 131: New parameter definition

    • GROUP - A group ID used to identify the group that includes the current parameter definition.
    • VISIBLE - Identifies whether the parameter is visible. The value of this field is 0 or 1.

      0 = invisible

      1 = visible

As the definition file sample shows, there are two groups:

  • MyGroup - ID 1 - Contains the parameter definition for MyParam which is a Text type parameter.
  • AnotherGroup - ID 2 - Contains the parameter definition for Price which is an Integer type parameter.