<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Built-In Enums? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570981#M82520</link>
    <description>At first, I didn't understand what you were looking for, but yes you are on the right track and you need a switch/ select case statement:&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
&lt;BR /&gt;
Dim nameValue As String = "" &lt;BR /&gt;
Select Case param.StorageType &lt;BR /&gt;
       Case Parameters.StorageType.Double &lt;BR /&gt;
               nameValue += param.AsDouble().ToString() &lt;BR /&gt;
       Case Parameters.StorageType.ElementId &lt;BR /&gt;
               nameValue += param.AsElementId().ToString() &lt;BR /&gt;
       Case Parameters.StorageType.Integer &lt;BR /&gt;
               nameValue += param.AsInteger().ToString &lt;BR /&gt;
       Case Parameters.StorageType.None &lt;BR /&gt;
               nameValue += param.AsValueString '"NONE" &lt;BR /&gt;
       Case Parameters.StorageType.String &lt;BR /&gt;
               nameValue += param.AsString() &lt;BR /&gt;
       Case Else &lt;BR /&gt;
              nameValue += "" &lt;BR /&gt;
End Select &lt;BR /&gt;
[\code]&lt;BR /&gt;
&lt;BR /&gt;
hope that helps !</description>
    <pubDate>Wed, 14 Oct 2009 13:27:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-10-14T13:27:05Z</dc:date>
    <item>
      <title>Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570978#M82517</link>
      <description>I'm finding that quite a few of the Built-In parameters are stored as &lt;BR /&gt;
integers, displayed in the Revit UI as strings.  Which means that there &lt;BR /&gt;
is an enum for those values somewhere...&lt;BR /&gt;
&lt;BR /&gt;
But how do I access them, for display only, without writing my own code &lt;BR /&gt;
to handle them on a case-by-case basis for hundreds of built-in parameters?&lt;BR /&gt;
&lt;BR /&gt;
For instance:&lt;BR /&gt;
Walls, Location Line or Structural Usage parameters:&lt;BR /&gt;
&lt;BR /&gt;
The Built-In "Location Line" parameter appears to be &lt;BR /&gt;
"WALL_KEY_REF_PARAM".  I've found a "WallKeyRef" Enum in the Object &lt;BR /&gt;
browser, but can't seem to access it because it isn't in a namespace &lt;BR /&gt;
within RevitAPI.dll?  Also, there's no explicit link I can find (name, &lt;BR /&gt;
reference id, whatever) between the API-available parameter definition, &lt;BR /&gt;
the built-in parameter name, and the enum, to where I could handle other &lt;BR /&gt;
cases programatically with the same sub/function.&lt;BR /&gt;
&lt;BR /&gt;
For the "Structural Usage" parameter, there appears to be *two* &lt;BR /&gt;
built-ins: "WALL_STRUCTURAL_USAGE_TEXT_PARAM" (which holds the string I &lt;BR /&gt;
want to display!), and "WALL_STRUCTURAL_USAGE_PARAM" (which holds the &lt;BR /&gt;
integer).  Again, there is a "WallStructuralUsage" enum, but it is &lt;BR /&gt;
inaccessible.  And again, no explicit link between everything.&lt;BR /&gt;
&lt;BR /&gt;
I *do* notice that the enums that I have found, if they can be accessed, &lt;BR /&gt;
are named similarly to the parameters, as are the two structural params &lt;BR /&gt;
above, but I am leery of relying on these conventions in my code, &lt;BR /&gt;
because I have always found Autodesk DB programming to be fraught with &lt;BR /&gt;
inconsistencies in naming things like this...&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Winterscheidt&lt;BR /&gt;
LWPB Architecture&lt;BR /&gt;
Oklahoma City, Oklahoma</description>
      <pubDate>Mon, 12 Oct 2009 16:03:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570978#M82517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-12T16:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570979#M82518</link>
      <description>Brian,&lt;BR /&gt;
I believe that if you have an instance of an object and you recover the &lt;BR /&gt;
parameter value as a string (instead of the integer value), then it comes &lt;BR /&gt;
back as shown in the UI. So that would help if you just want to display the &lt;BR /&gt;
parameter's current value.&lt;BR /&gt;
&lt;BR /&gt;
"Brian Winterscheidt" &lt;BWINTERSCHEIDT-NO&gt; wrote in message &lt;BR /&gt;
news:6269919@discussion.autodesk.com...&lt;BR /&gt;
I'm finding that quite a few of the Built-In parameters are stored as&lt;BR /&gt;
integers, displayed in the Revit UI as strings.  Which means that there&lt;BR /&gt;
is an enum for those values somewhere...&lt;BR /&gt;
&lt;BR /&gt;
But how do I access them, for display only, without writing my own code&lt;BR /&gt;
to handle them on a case-by-case basis for hundreds of built-in parameters?&lt;BR /&gt;
&lt;BR /&gt;
For instance:&lt;BR /&gt;
Walls, Location Line or Structural Usage parameters:&lt;BR /&gt;
&lt;BR /&gt;
The Built-In "Location Line" parameter appears to be&lt;BR /&gt;
"WALL_KEY_REF_PARAM".  I've found a "WallKeyRef" Enum in the Object&lt;BR /&gt;
browser, but can't seem to access it because it isn't in a namespace&lt;BR /&gt;
within RevitAPI.dll?  Also, there's no explicit link I can find (name,&lt;BR /&gt;
reference id, whatever) between the API-available parameter definition,&lt;BR /&gt;
the built-in parameter name, and the enum, to where I could handle other&lt;BR /&gt;
cases programatically with the same sub/function.&lt;BR /&gt;
&lt;BR /&gt;
For the "Structural Usage" parameter, there appears to be *two*&lt;BR /&gt;
built-ins: "WALL_STRUCTURAL_USAGE_TEXT_PARAM" (which holds the string I&lt;BR /&gt;
want to display!), and "WALL_STRUCTURAL_USAGE_PARAM" (which holds the&lt;BR /&gt;
integer).  Again, there is a "WallStructuralUsage" enum, but it is&lt;BR /&gt;
inaccessible.  And again, no explicit link between everything.&lt;BR /&gt;
&lt;BR /&gt;
I *do* notice that the enums that I have found, if they can be accessed,&lt;BR /&gt;
are named similarly to the parameters, as are the two structural params&lt;BR /&gt;
above, but I am leery of relying on these conventions in my code,&lt;BR /&gt;
because I have always found Autodesk DB programming to be fraught with&lt;BR /&gt;
inconsistencies in naming things like this...&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Winterscheidt&lt;BR /&gt;
LWPB Architecture&lt;BR /&gt;
Oklahoma City, Oklahoma&lt;/BWINTERSCHEIDT-NO&gt;</description>
      <pubDate>Wed, 14 Oct 2009 12:35:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570979#M82518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T12:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570980#M82519</link>
      <description>David Bartliff wrote:&lt;BR /&gt;
&amp;gt; Brian,&lt;BR /&gt;
&amp;gt; I believe that if you have an instance of an object and you recover the &lt;BR /&gt;
&amp;gt; parameter value as a string (instead of the integer value), then it comes &lt;BR /&gt;
&amp;gt; back as shown in the UI. So that would help if you just want to display the &lt;BR /&gt;
&amp;gt; parameter's current value.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
On length/area/volume/angle parameters stored as doubles, I have used &lt;BR /&gt;
the .AsValueString to return what is seen in the UI (or something close &lt;BR /&gt;
to it).&lt;BR /&gt;
&lt;BR /&gt;
On most integer-based built-in parameters, I can't get those same results:&lt;BR /&gt;
.ToString returns the parameter name&lt;BR /&gt;
.AsValueString returns nothing&lt;BR /&gt;
.AsString  returns nothing&lt;BR /&gt;
.AsDouble returns 0&lt;BR /&gt;
.AsInteger returns numeric value&lt;BR /&gt;
.AsElementId returns nothing/invalid id&lt;BR /&gt;
&lt;BR /&gt;
Am I going about this the wrong way?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Winterscheidt&lt;BR /&gt;
LWPB Architecture&lt;BR /&gt;
Oklahoma City, Oklahoma</description>
      <pubDate>Wed, 14 Oct 2009 13:15:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570980#M82519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T13:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570981#M82520</link>
      <description>At first, I didn't understand what you were looking for, but yes you are on the right track and you need a switch/ select case statement:&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
&lt;BR /&gt;
Dim nameValue As String = "" &lt;BR /&gt;
Select Case param.StorageType &lt;BR /&gt;
       Case Parameters.StorageType.Double &lt;BR /&gt;
               nameValue += param.AsDouble().ToString() &lt;BR /&gt;
       Case Parameters.StorageType.ElementId &lt;BR /&gt;
               nameValue += param.AsElementId().ToString() &lt;BR /&gt;
       Case Parameters.StorageType.Integer &lt;BR /&gt;
               nameValue += param.AsInteger().ToString &lt;BR /&gt;
       Case Parameters.StorageType.None &lt;BR /&gt;
               nameValue += param.AsValueString '"NONE" &lt;BR /&gt;
       Case Parameters.StorageType.String &lt;BR /&gt;
               nameValue += param.AsString() &lt;BR /&gt;
       Case Else &lt;BR /&gt;
              nameValue += "" &lt;BR /&gt;
End Select &lt;BR /&gt;
[\code]&lt;BR /&gt;
&lt;BR /&gt;
hope that helps !</description>
      <pubDate>Wed, 14 Oct 2009 13:27:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570981#M82520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T13:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570982#M82521</link>
      <description>ppathak wrote:&lt;BR /&gt;
&amp;gt; hope that helps !&lt;BR /&gt;
&lt;BR /&gt;
unfortunately, no.  I have this already.  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
For Built-In parameters that have drop-down menus of options in the &lt;BR /&gt;
Revit UI, typically of StorageType=Integer and ParameterType=Invalid, I &lt;BR /&gt;
can't find a way to obtain anything other than the integer value.&lt;BR /&gt;
&lt;BR /&gt;
Wall's "Location Line" has 6 possible values.&lt;BR /&gt;
&lt;BR /&gt;
Wall's "Structural Usage" has 4 values.&lt;BR /&gt;
&lt;BR /&gt;
Roof's "Rafter Cut" has 3 values.&lt;BR /&gt;
&lt;BR /&gt;
Structural Column's "Top Release" and "Bottom Release" each have 4 &lt;BR /&gt;
possible values.&lt;BR /&gt;
&lt;BR /&gt;
Structural Beam's "Lateral Justification" has 3, "z-Direction &lt;BR /&gt;
Justification" and "Stick Symbol Location" have 4, "Structural Usage" &lt;BR /&gt;
has 5 values.&lt;BR /&gt;
&lt;BR /&gt;
And on and on.&lt;BR /&gt;
&lt;BR /&gt;
I can't find a way to get from the integer to the built-in enum, so I'm &lt;BR /&gt;
having to write a *lot* of enums myself.  And translate them, or leave &lt;BR /&gt;
them as english-only in my UI regardless of Revit language.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Winterscheidt</description>
      <pubDate>Wed, 14 Oct 2009 14:20:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570982#M82521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T14:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570983#M82522</link>
      <description>ppathak wrote:&lt;BR /&gt;
&amp;gt; hope that helps !&lt;BR /&gt;
&lt;BR /&gt;
not quite,&lt;BR /&gt;
ppathak.&lt;BR /&gt;
&lt;BR /&gt;
your code example only provides a way to properly, and *directly*, &lt;BR /&gt;
translate non-String data into a String;&lt;BR /&gt;
but Brian's issue is a bit more complex than that.&lt;BR /&gt;
&lt;BR /&gt;
Take this example:&lt;BR /&gt;
In the RVT GUI, the Wall Parameter "Structural Usage" displays as a listing &lt;BR /&gt;
of Text:&lt;BR /&gt;
Non-bearing&lt;BR /&gt;
Bearing&lt;BR /&gt;
Shear&lt;BR /&gt;
Structural Combined&lt;BR /&gt;
&lt;BR /&gt;
But what Brian has found is that in the actual *database* these values are &lt;BR /&gt;
stored as integers;&lt;BR /&gt;
where (guessing):&lt;BR /&gt;
1 = Non-bearing&lt;BR /&gt;
2 = Bearing&lt;BR /&gt;
3 = Shear&lt;BR /&gt;
4 = Structural Combined&lt;BR /&gt;
&lt;BR /&gt;
Brian has also uncovered, through the use of the Object Browser, that there &lt;BR /&gt;
are specialized Enums present that provide the "Translation Keys" for &lt;BR /&gt;
getting from a database integer value to the GUI string value; for the &lt;BR /&gt;
various Parameters that work in this way. Unfortunately, he has not been &lt;BR /&gt;
able to find a way to access these Enums via RVT's API.&lt;BR /&gt;
&lt;BR /&gt;
Your code example would likely translate an integer of 1, into a string of &lt;BR /&gt;
"1";&lt;BR /&gt;
and not the GUI String value that is needed.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
CoreyL</description>
      <pubDate>Wed, 14 Oct 2009 14:28:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570983#M82522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570984#M82523</link>
      <description>Brian and CoreyL,&lt;BR /&gt;
&lt;BR /&gt;
Ah, .. I see it now. Sorry, I didn't understand the problem initially (even though I thought I did &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ) ! Hope you find the solution soon, this would be helpful. &lt;BR /&gt;&lt;BR /&gt;
Prashant

Edited by: ppathak on Oct 14, 2009 10:34 AM</description>
      <pubDate>Wed, 14 Oct 2009 14:33:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570984#M82523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T14:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570985#M82524</link>
      <description>One place revit has stored MANY (but maybe not all) of its enumerators is Autodesk.Revit.Enums. Use the object browser (VS 2005, View/Object Browser) to find this list. On any objects you have your cursor on, rightclick and select, Goto Definition and if it is a Revit object, it will jump to the object browser. Sometimes you can find the enumeration list within the object itself. Start poking around there.&lt;BR /&gt;
&lt;BR /&gt;
You can also find other enums namespaces in structrural and such.  Usually the object your after will have a property that points out where to go, like wall, Structural usage:&lt;BR /&gt;
&lt;BR /&gt;
&lt;P&gt;
Public Property &lt;STRONG&gt;StructuralUsage&lt;/STRONG&gt;() As &lt;STRONG&gt;&lt;U&gt;Autodesk&lt;/U&gt;&lt;/STRONG&gt;.&lt;STRONG&gt;&lt;U&gt;Revit&lt;/U&gt;&lt;/STRONG&gt;.&lt;STRONG&gt;&lt;U&gt;Structural&lt;/U&gt;&lt;/STRONG&gt;.&lt;STRONG&gt;&lt;U&gt;Enums&lt;/U&gt;&lt;/STRONG&gt;.&lt;STRONG&gt;&lt;U&gt;WallUsage&lt;/U&gt;&lt;/STRONG&gt;
&lt;/P&gt;
&lt;P&gt;
Member of: &lt;STRONG&gt;&lt;U&gt;Autodesk&lt;/U&gt;&lt;/STRONG&gt;.&lt;STRONG&gt;&lt;U&gt;Revit&lt;/U&gt;&lt;/STRONG&gt;.&lt;STRONG&gt;&lt;U&gt;Elements&lt;/U&gt;&lt;/STRONG&gt;.&lt;STRONG&gt;&lt;U&gt;Wall&lt;/U&gt;&lt;/STRONG&gt;
&lt;/P&gt;
&lt;BR /&gt;
jvj

Edited by: JamieVJohnson on Oct 14, 2009 9:45 AM</description>
      <pubDate>Wed, 14 Oct 2009 14:44:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570985#M82524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T14:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570986#M82525</link>
      <description>OOPS  .... JamieVJhonson beats me to it.... man I should have been quicker... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
OK,&lt;BR /&gt;
Here is another .. for the Rafter cut on the Roof :&lt;BR /&gt;
&lt;BR /&gt;
footPrintRoof.EaveCuts = Autodesk.Revit.Enums.EaveCutterType.PlumbCut&lt;BR /&gt;
&lt;BR /&gt;
Hope that helps !&lt;BR /&gt;
&lt;BR /&gt;
Prashant&lt;BR /&gt;
&lt;BR /&gt;
Edited by: ppathak on Oct 14, 2009 12:12 PM

Edited by: ppathak on Oct 14, 2009 12:14 PM</description>
      <pubDate>Wed, 14 Oct 2009 15:42:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/2570986#M82525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-14T15:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/10622415#M82526</link>
      <description>&lt;P&gt;Hey&amp;nbsp; Brian,&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;have you found the solution to this problem? I am facing the same situation as you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:43:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/10622415#M82526</guid>
      <dc:creator>tiago.cerqueiraQPL4Y</dc:creator>
      <dc:date>2021-09-14T19:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Built-In Enums?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/10622877#M82527</link>
      <description>&lt;P&gt;Not sure everything has an enum but the ones that exist can be found with reflection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I believe the best source of information for this is RevitAPI.chm&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 00:20:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/built-in-enums/m-p/10622877#M82527</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-09-15T00:20:37Z</dc:date>
    </item>
  </channel>
</rss>

