<?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: Get Element's LevelID through .LevelID or through Params in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/11511971#M47104</link>
    <description>&lt;P&gt;Thank you for the sample model. I &lt;A href="https://autodesk.slack.com/archives/C0LP63082/p1666857217067219" target="_blank"&gt;passed&lt;/A&gt; it on to the development team and asked them for an explanation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2022 07:55:09 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2022-10-27T07:55:09Z</dc:date>
    <item>
      <title>Get Element's LevelID through .LevelID or through Params</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8319458#M47099</link>
      <description>&lt;P&gt;In a model that I'm analyzing I find many elements where&amp;nbsp;their&lt;/P&gt;&lt;PRE&gt;element.LevelId&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;is -1, but the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;element.LookupParameter("Level").AsElementId().IntegerValue&lt;/PRE&gt;&lt;P&gt;Has a valid level value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the difference, and should I fall back from the first method to the second one if the value is -1?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 11:40:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8319458#M47099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-08T11:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get Element's LevelID through .LevelID or through Params</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8319612#M47100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both are same and returns you the same value&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Element.LevelId&lt;/STRONG&gt; gives you Id of&amp;nbsp; your selected element Level.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Element.LookupParameter("Level").AsElementId().IntegerValue&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;will search for the parameter "Level"and gets the elementid of the level and displays it as an integer value.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 12:37:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8319612#M47100</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2018-10-08T12:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get Element's LevelID through .LevelID or through Params</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8319786#M47101</link>
      <description>&lt;P&gt;In the model I'm working on there are hundreds of elements where these 2 values are different.&lt;/P&gt;&lt;P&gt;element.LevelId is -1, and&amp;nbsp;the second method returns a valid ID (not -1)&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 13:34:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8319786#M47101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-08T13:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get Element's LevelID through .LevelID or through Params</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8798557#M47102</link>
      <description>&lt;P&gt;I ran into this today as well.&amp;nbsp; The elements in question were created via a 3rd party application. I was able to get the level id via a different route.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Level lvl = doc.GetElement(pipe.ReferenceLevel.Id) as Level;&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 16:57:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/8798557#M47102</guid>
      <dc:creator>draynorQNHWR</dc:creator>
      <dc:date>2019-05-17T16:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get Element's LevelID through .LevelID or through Params</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/11511119#M47103</link>
      <description>&lt;P&gt;I'm having the exact same problem. I placed a standard Two Way Switch into my model.&lt;/P&gt;&lt;P&gt;Revit Lookup shows LevelId as -1, but the schedule level is set correctly in the element's Properties view, plus the correct level can be found in the family instance's Parameters for both the Schedule Level and the Level Parameter (checked via Revit Lookup). Does this have to do with the way the families are inserted? This makes any type of filtering via ElementLevelFilter extremely error-prone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: Here is a super simple example of what I mean. Note the light switch in Room 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 22:34:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/11511119#M47103</guid>
      <dc:creator>grubdex</dc:creator>
      <dc:date>2022-10-26T22:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get Element's LevelID through .LevelID or through Params</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/11511971#M47104</link>
      <description>&lt;P&gt;Thank you for the sample model. I &lt;A href="https://autodesk.slack.com/archives/C0LP63082/p1666857217067219" target="_blank"&gt;passed&lt;/A&gt; it on to the development team and asked them for an explanation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 07:55:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-element-s-levelid-through-levelid-or-through-params/m-p/11511971#M47104</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-10-27T07:55:09Z</dc:date>
    </item>
  </channel>
</rss>

