<?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: Parameter Clear Values in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10015993#M28915</link>
    <description>&lt;P&gt;Small addition: this method can be applied only for Shared Parameters.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2021 13:30:16 GMT</pubDate>
    <dc:creator>architect.bim</dc:creator>
    <dc:date>2021-01-20T13:30:16Z</dc:date>
    <item>
      <title>Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10015851#M28913</link>
      <description>&lt;P&gt;Can someone please explain how &lt;A href="https://www.revitapidocs.com/2020/14658620-d5d5-d8f2-1b6c-343180951d63.htm" target="_blank" rel="noopener"&gt;Parameter.ClearValue()&lt;/A&gt; work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see this new feature has been implemented &lt;A href="https://thebuildingcoder.typepad.com/blog/2019/04/whats-new-in-the-revit-2020-api.html#4.2.8.2" target="_blank" rel="noopener"&gt;from 2020 API&lt;/A&gt;, but i struggle to make it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 12:45:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10015851#M28913</guid>
      <dc:creator>Rajamanickam.G</dc:creator>
      <dc:date>2021-01-20T12:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10015984#M28914</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;Some parameters have there&amp;nbsp;&lt;SPAN&gt;initial value. For example if you create project "Yes/No" parameter in Revit UI it looks like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="210120_1620_002.jpg" style="width: 372px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/869071iFAF5E2D533C696E5/image-dimensions/372x27?v=v2" width="372" height="27" role="button" title="210120_1620_002.jpg" alt="210120_1620_002.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It is neither checked, nor unchecked.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you check it once you are unable to return it to its initial state again via UI. But Revit API allows you to do this with ClearValue() method.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There are some other cases when it may be helpful. For instance if you work with Shared Parameters and make them visible only if they have value. If you want them to disappear again from UI, you need to use this method to turn them to initial state.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 13:27:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10015984#M28914</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-01-20T13:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10015993#M28915</link>
      <description>&lt;P&gt;Small addition: this method can be applied only for Shared Parameters.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 13:30:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10015993#M28915</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-01-20T13:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016073#M28916</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4552025"&gt;@architect.bim&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. It is clear and I am now able to get some picture of how this works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am actually after, I could explain with an example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a shared parameter called &lt;STRONG&gt;SP_Space_Temperature&lt;/STRONG&gt; with &lt;SPAN class="aCOpRe"&gt;&lt;SPAN&gt;°C&lt;/SPAN&gt;&lt;/SPAN&gt; as unit and null as value.&lt;/P&gt;&lt;P&gt;Once someone enters a value and applies it to the element, it always requires a value, but in my case I don't need any value even 0 and want to reset it to the initial value i.e null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Values" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/869088i859F788F4EF09A0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="12.png" alt="Values" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Values&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it shows the following error when i try to erase the value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error" style="width: 352px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/869094i2ED0C46B7B5CB5D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="13.png" alt="error" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;error&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i thought this could be solved with Parameter.ClearValue() method. Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 13:49:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016073#M28916</guid>
      <dc:creator>Rajamanickam.G</dc:creator>
      <dc:date>2021-01-20T13:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016192#M28917</link>
      <description>&lt;P&gt;I think this method is definitely for your case!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 14:28:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016192#M28917</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-01-20T14:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016219#M28918</link>
      <description>&lt;P&gt;This is what I tried till now&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public void resetParamValues()
{
    UIDocument uidoc = this.ActiveUIDocument;
    Document doc = uidoc.Document;
    
    Selection sel = uidoc.Selection;
    Reference spaRefer = sel.PickObject(ObjectType.Element, "Select the space");
    
    var elem = doc.GetElement(spaRefer) as Element;
    
    var parameter = elem.LookupParameter("SP_Space_Temperature");
    
    var check = parameter.ClearValue();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error message" style="width: 368px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/869115i2B452CF16D7C2F1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="14.png" alt="error message" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;error message&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How could i set the &lt;STRONG&gt;HideWhenNoValue&lt;/STRONG&gt; of this shared parameter to true? and clear the value?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 14:38:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016219#M28918</guid>
      <dc:creator>Rajamanickam.G</dc:creator>
      <dc:date>2021-01-20T14:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016430#M28919</link>
      <description>&lt;P&gt;Oh, I see. Unfortunately there is one more limitation written in docs (sorry, I missed it).&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"This method will only succeed for Shared parameters that have their HideWhenNoValue property set to true".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This property can be set to true only in Shared Parameters File before you add your parameter to the project.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can do it either through Revit API (modifying &lt;A href="http://HideWhenNoValue" target="_blank" rel="noopener"&gt;ExternalDefinition&lt;/A&gt; object) or manually - open Shared Parameters File in text editor and change value for a particular parameter.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="210120_1836_003.jpg" style="width: 736px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/869156i5518883B45D57138/image-dimensions/736x267?v=v2" width="736" height="267" role="button" title="210120_1836_003.jpg" alt="210120_1836_003.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After this you can add this parameter to your project. And use ClearValue method. But keep in mind: with&amp;nbsp;&lt;SPAN&gt;HideWhenNoValue property set to True your parameter will also be hidden in Revit UI after you use this method.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But unfortunately there is no other way to turn parameter value to its initial state.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 15:43:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016430#M28919</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-01-20T15:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016867#M28920</link>
      <description>&lt;P&gt;Very nice. This actually works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you are right if we turn the property &lt;STRONG&gt;HideWhenNoValue&lt;/STRONG&gt; on, then we don't have the possibility to enter the value again after clearing the values since they disappear from the UI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your time.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:52:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10016867#M28920</guid>
      <dc:creator>Rajamanickam.G</dc:creator>
      <dc:date>2021-01-20T17:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter Clear Values</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10244317#M28921</link>
      <description>&lt;P&gt;I had hoped that ClearValue would reset any parameter back to the 'unchanged' state. This is of very limited use when only available for shared parameters with&amp;nbsp;&lt;SPAN&gt;HideWhenNoValue&amp;nbsp;set to true as this feature, though useful, is probably not used that often as the user can not set a value manually. Oh well - maybe we will be given a Reset() method in a future release...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 13:43:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/parameter-clear-values/m-p/10244317#M28921</guid>
      <dc:creator>ciganek</dc:creator>
      <dc:date>2021-04-16T13:43:51Z</dc:date>
    </item>
  </channel>
</rss>

