<?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: Element Returns null in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/element-returns-null/m-p/10294353#M26143</link>
    <description>&lt;P&gt;So, you are saying that&amp;nbsp;&lt;SPAN&gt;224716 is the valid integer value of the element id.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That is good to know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please note that the string "224716" is something completely different. A string is not a number, nor an element id.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In this case, however, a string might very well be a Revit unique id.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And, lo and behold, the GetElement method provides three overloads, one taking an element id, another a string-valued unique id:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.revitapidocs.com/2021.1/8760be74-50fd-6809-aec6-3cb168d03ea5.htm" target="_blank"&gt;https://www.revitapidocs.com/2021.1/8760be74-50fd-6809-aec6-3cb168d03ea5.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To make use of your integer-valued element id, you need to convert the number (not the string) to an ElementId object and pass in that to GetElement. Since this is demonstrated in a numerous different places, I am sure you have already solved this problem yourself long before I finished typing this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 09:36:23 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2021-05-06T09:36:23Z</dc:date>
    <item>
      <title>Element Returns null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/element-returns-null/m-p/10293326#M26142</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know what i'm missing here.. I'm trying to set the value of a parameter after i retrieve the element from a set of ids. However, the element is returning null and i'm a receiving an error "Object reference not set to an instance of an object"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Element elem = activeDoc.GetElement("224716") as Element;&lt;BR /&gt;&lt;BR /&gt;Parameter RW_CV1 = elem.LookupParameter("RW_CV-1");&lt;BR /&gt;RW_CV1.Set("New");&lt;BR /&gt;RW_CV1.SetValueString("New");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please note that 224716 is a valid id of the element. I can double check that using select by id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mohamed.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 21:05:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/element-returns-null/m-p/10293326#M26142</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2021-05-05T21:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Element Returns null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/element-returns-null/m-p/10294353#M26143</link>
      <description>&lt;P&gt;So, you are saying that&amp;nbsp;&lt;SPAN&gt;224716 is the valid integer value of the element id.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That is good to know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please note that the string "224716" is something completely different. A string is not a number, nor an element id.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In this case, however, a string might very well be a Revit unique id.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And, lo and behold, the GetElement method provides three overloads, one taking an element id, another a string-valued unique id:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.revitapidocs.com/2021.1/8760be74-50fd-6809-aec6-3cb168d03ea5.htm" target="_blank"&gt;https://www.revitapidocs.com/2021.1/8760be74-50fd-6809-aec6-3cb168d03ea5.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To make use of your integer-valued element id, you need to convert the number (not the string) to an ElementId object and pass in that to GetElement. Since this is demonstrated in a numerous different places, I am sure you have already solved this problem yourself long before I finished typing this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 09:36:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/element-returns-null/m-p/10294353#M26143</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-05-06T09:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Element Returns null</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/element-returns-null/m-p/10295984#M26144</link>
      <description>&lt;P&gt;Thank you Jeremy. That did it.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 19:15:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/element-returns-null/m-p/10295984#M26144</guid>
      <dc:creator>mohd.fadel</dc:creator>
      <dc:date>2021-05-06T19:15:31Z</dc:date>
    </item>
  </channel>
</rss>

