Message 1 of 11
Built-In Enums?
Not applicable
10-12-2009
09:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm finding that quite a few of the Built-In parameters are stored as
integers, displayed in the Revit UI as strings. Which means that there
is an enum for those values somewhere...
But how do I access them, for display only, without writing my own code
to handle them on a case-by-case basis for hundreds of built-in parameters?
For instance:
Walls, Location Line or Structural Usage parameters:
The Built-In "Location Line" parameter appears to be
"WALL_KEY_REF_PARAM". I've found a "WallKeyRef" Enum in the Object
browser, but can't seem to access it because it isn't in a namespace
within RevitAPI.dll? Also, there's no explicit link I can find (name,
reference id, whatever) between the API-available parameter definition,
the built-in parameter name, and the enum, to where I could handle other
cases programatically with the same sub/function.
For the "Structural Usage" parameter, there appears to be *two*
built-ins: "WALL_STRUCTURAL_USAGE_TEXT_PARAM" (which holds the string I
want to display!), and "WALL_STRUCTURAL_USAGE_PARAM" (which holds the
integer). Again, there is a "WallStructuralUsage" enum, but it is
inaccessible. And again, no explicit link between everything.
I *do* notice that the enums that I have found, if they can be accessed,
are named similarly to the parameters, as are the two structural params
above, but I am leery of relying on these conventions in my code,
because I have always found Autodesk DB programming to be fraught with
inconsistencies in naming things like this...
--
Brian Winterscheidt
LWPB Architecture
Oklahoma City, Oklahoma
integers, displayed in the Revit UI as strings. Which means that there
is an enum for those values somewhere...
But how do I access them, for display only, without writing my own code
to handle them on a case-by-case basis for hundreds of built-in parameters?
For instance:
Walls, Location Line or Structural Usage parameters:
The Built-In "Location Line" parameter appears to be
"WALL_KEY_REF_PARAM". I've found a "WallKeyRef" Enum in the Object
browser, but can't seem to access it because it isn't in a namespace
within RevitAPI.dll? Also, there's no explicit link I can find (name,
reference id, whatever) between the API-available parameter definition,
the built-in parameter name, and the enum, to where I could handle other
cases programatically with the same sub/function.
For the "Structural Usage" parameter, there appears to be *two*
built-ins: "WALL_STRUCTURAL_USAGE_TEXT_PARAM" (which holds the string I
want to display!), and "WALL_STRUCTURAL_USAGE_PARAM" (which holds the
integer). Again, there is a "WallStructuralUsage" enum, but it is
inaccessible. And again, no explicit link between everything.
I *do* notice that the enums that I have found, if they can be accessed,
are named similarly to the parameters, as are the two structural params
above, but I am leery of relying on these conventions in my code,
because I have always found Autodesk DB programming to be fraught with
inconsistencies in naming things like this...
--
Brian Winterscheidt
LWPB Architecture
Oklahoma City, Oklahoma