<?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: Accessing Revit 2016 Global Parameters in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291906#M66132</link>
    <description>&lt;P&gt;If you look at the DoubleParameterValue members there is a "Value" property. &amp;nbsp;So it should be x.GetValue().Value and returns a double.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2016 20:16:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-04-25T20:16:21Z</dc:date>
    <item>
      <title>Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291069#M66127</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am working on a Revit 2016 program in which I'd like to access the value of a Global Parameter. From working in the API I understand the following things exist:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Autodesk.Revit.DB.GlobalParametersManager&lt;/P&gt;&lt;P&gt;Autodesk.Revit.DB.GlobalParameter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I haven't quite figured out how to employ these, and I can't seem to find any information about them in the SDK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current way I am trying to implement&amp;nbsp;them is something like this:&lt;/P&gt;&lt;P&gt;//**********************************************************************&lt;/P&gt;&lt;P&gt;//***************************Start Here*********************************&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ElementId globalParam1&amp;nbsp;= GlobalParametersManager.FindByName(doc, "Global Parameter 1");&lt;BR /&gt;if (globalParameter1 == null)&lt;BR /&gt;{&lt;BR /&gt;TaskDialog.Show("GP Error 1", "There was a problem finding&amp;nbsp;Global Parameter 1.");&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Element gp1Element = doc.GetElement(globalParam1);&lt;BR /&gt;double gp1&amp;nbsp;= gp1Element.LookupParameter("Value").AsDouble();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//****************************Fin***************************************&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//**********************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help on how to access these values or locations of some documentation&amp;nbsp;containing info&amp;nbsp;about using/accessing Global Parameters with the Revit API would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks In Advance,&lt;/P&gt;&lt;P&gt;RH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 15:03:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291069#M66127</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2016-04-25T15:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291133#M66128</link>
      <description>&lt;P&gt;Try&amp;nbsp;&lt;SPAN&gt;casting&amp;nbsp;&lt;SPAN&gt;gp1Element to a GlobalParameter and then use the GlobalParameter.GetValue() method. &amp;nbsp;There's a plethora of info in the main GlobalParameter class page in the API help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 15:20:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291133#M66128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T15:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291275#M66129</link>
      <description>&lt;P&gt;Thanks for your quick reply, I have begun to implement your casting suggestion.... will post results!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 16:04:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291275#M66129</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2016-04-25T16:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291603#M66130</link>
      <description>*Edit* Also I was working with the 2016 SDK and not using R2 so I am currently updating to R2 2016 Revit SDK</description>
      <pubDate>Mon, 25 Apr 2016 17:56:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291603#M66130</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2016-04-25T17:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291669#M66131</link>
      <description>&lt;P&gt;Okay so I haven successfully cast it as a GlobalParameter and used the x.GetValue() command on it. The issue now is that it will not let me use the value as a double (the parameter value is a decimal value). I have tried to use both the "x.AsDouble()" and "x.AsValueString()" and they also do not work. When I output the "x.GetValue().ToString()" it does not tell me the parameter value, but only that it is "Autodesk.Revit.DB.DoubleParameterValue".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 18:31:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291669#M66131</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2016-04-25T18:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291906#M66132</link>
      <description>&lt;P&gt;If you look at the DoubleParameterValue members there is a "Value" property. &amp;nbsp;So it should be x.GetValue().Value and returns a double.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 20:16:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291906#M66132</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T20:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291916#M66133</link>
      <description>I have tried that and ".Value()" does not appear to be a valid method for ".GetValue()"</description>
      <pubDate>Mon, 25 Apr 2016 20:20:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291916#M66133</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2016-04-25T20:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291920#M66134</link>
      <description>&lt;P&gt;Its a property. &amp;nbsp;Not a method. &amp;nbsp;So remove the parenthesis.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 20:22:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291920#M66134</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T20:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291927#M66135</link>
      <description>It does not appear to work as either one.</description>
      <pubDate>Mon, 25 Apr 2016 20:25:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6291927#M66135</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2016-04-25T20:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Revit 2016 Global Parameters</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6294093#M66136</link>
      <description>***Final Update***&lt;BR /&gt;&lt;BR /&gt;The final trick was casting from Element to GlobalParameter, then casting again from GlobalParameter to (your recommended) DoubleParameterValue (used with the x.GetValue() method).&lt;BR /&gt;&lt;BR /&gt;Once it was cast as a DoubleParameterValue I was able to use your recommended x.GetValue().Value property, and it all worked out exactly as I'd hoped.&lt;BR /&gt;Thanks for your help, it is much appreciated!</description>
      <pubDate>Tue, 26 Apr 2016 18:30:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/accessing-revit-2016-global-parameters/m-p/6294093#M66136</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2016-04-26T18:30:18Z</dc:date>
    </item>
  </channel>
</rss>

