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.
The shared parameter definition file is a text file (.txt) with three blocks: META, GROUP and PARAM. The GROUP and PARAM blocks are relevant to the shared parameter functionality in the Revit API.
Although the Revit API takes care of reading and writing this file, the following section provides information the format of the file, which closely corresponds to the API objects and methods used to access shared parameters. The file uses tabs to separate fields and can be difficult to read in a text editor. The code region below shows the contents of a sample shared parameter text file.
Code Region 22-1: Parameter definition file example |
# This is a Revit shared parameter file. # Do not edit manually. *META VERSION MINVERSION META 2 1 *GROUP ID NAME GROUP 1 MyGroup GROUP 2 AnotherGroup *PARAM GUID NAME DATATYPE DATACATEGORY GROUP VISIBLE DESCRIPTION USERMODIFIABLE PARAM bb7f0005-9692-4b76-8fa3-30cec8aecf74 Price INTEGER 2 1 Enter price in USD 1 PARAM b7ea2654-b206-4694-a087-756359b52e7f areaTags FAMILYTYPE -2005020 1 1 1 PARAM d1a5439d-dc8d-4053-99fa-2f33804bae0e MyParam TEXT 1 1 1 |
0 = invisible
1 = visible
0 = user cannot edit the parameter and it is greyed out in the UI
1 = user can edit the parameter value in the UI
In the sample definition file, there are two groups:
Of the 3 parameters in the sample file, only Price has a description. All of the parameters are visible and user modifiable.