<?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 BuiltInParameter by Id in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637406#M6643</link>
    <description>&lt;P&gt;Okay so two things.&lt;/P&gt;&lt;P&gt;- I'm writing in python (forgot to say that)&lt;/P&gt;&lt;P&gt;- Imagine that I understand Revit API, but little about programming. I have no idea what casting means or does.&lt;BR /&gt;&lt;BR /&gt;I didn't post here because I'm to lazy to google, I posted here because everything you find online assumes you're already a master programmer.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 10:39:47 GMT</pubDate>
    <dc:creator>PieterL_TM</dc:creator>
    <dc:date>2024-03-13T10:39:47Z</dc:date>
    <item>
      <title>Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637343#M6641</link>
      <description>&lt;P&gt;In my script, I get an Id of a BuiltInParameter (e.g. '-1002300' &lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;How can I get the BuiltInParameter from this Id?&lt;BR /&gt;doc.GetElement() returns none.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the correct way to do this&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 10:04:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637343#M6641</guid>
      <dc:creator>PieterL_TM</dc:creator>
      <dc:date>2024-03-13T10:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637396#M6642</link>
      <description>&lt;P&gt;You can obtain the &lt;STRONG&gt;&lt;U&gt;BuiltInParameter&lt;/U&gt;&lt;/STRONG&gt; enumeration value from its integer representation using the standard C# procedure, so simply search the Internet for something like "c# get enum from int" or read a basic C# tutorial:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://duckduckgo.com/?q=c%23%20get%20enum%20from%20int" target="_blank"&gt;https://duckduckgo.com/?q=c%23%20get%20enum%20from%20int&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 10:30:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637396#M6642</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2024-03-13T10:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637406#M6643</link>
      <description>&lt;P&gt;Okay so two things.&lt;/P&gt;&lt;P&gt;- I'm writing in python (forgot to say that)&lt;/P&gt;&lt;P&gt;- Imagine that I understand Revit API, but little about programming. I have no idea what casting means or does.&lt;BR /&gt;&lt;BR /&gt;I didn't post here because I'm to lazy to google, I posted here because everything you find online assumes you're already a master programmer.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 10:39:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637406#M6643</guid>
      <dc:creator>PieterL_TM</dc:creator>
      <dc:date>2024-03-13T10:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637420#M6644</link>
      <description>&lt;P&gt;OK, so a thing or two from me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I am not a Python user&lt;/LI&gt;
&lt;LI&gt;I am trying to help you as best I can&lt;/LI&gt;
&lt;LI&gt;I am trying to be efficient, so I can help others as well&lt;/LI&gt;
&lt;LI&gt;I searched next for "cast python int enum":&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://duckduckgo.com/?q=cast%20python%20int%20enum" target="_blank"&gt;https://duckduckgo.com/?q=cast%20python%20int%20enum&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;I think you might be capable of doing so as well, even as a non-master programmer&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for answering in the same vein... I have way too far mirroring neurons... please excuse that. And let's have fun, be friendly and supportive. I am afraid that I am often a bit terse, in addition to that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 10:47:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637420#M6644</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2024-03-13T10:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637975#M6645</link>
      <description>&lt;P&gt;Use this code in Python to get the ParameterElement from idOfYourParameter:&lt;/P&gt;&lt;P&gt;parameterFromId = activeDoc.GetElement(ElementId(int(str(idOfYourParameter))))&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 14:31:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12637975#M6645</guid>
      <dc:creator>studio-a-int</dc:creator>
      <dc:date>2024-03-13T14:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12638029#M6646</link>
      <description>&lt;P&gt;It returns 'none', With your line you convert an Id to a string to an integer and then back to an Id, so same thing we started with.&lt;BR /&gt;Since I'm looking for a BuiltInParameter, it returns 'none'&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 14:47:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12638029#M6646</guid>
      <dc:creator>PieterL_TM</dc:creator>
      <dc:date>2024-03-13T14:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12638109#M6647</link>
      <description>&lt;P&gt;If returns None, you are using an Id that is not valid. Check first to make sure you have the correct Id. To test that, run the code below. Pick up one of the ids listed and run it in the line I posted for you. You will see that works if you have the correct Id value, otherwise you are getting None.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;parameters = FilteredElementCollector(activeDoc).OfClass(Autodesk.Revit.DB.ParameterElement).ToElements()&lt;BR /&gt;parametersNames = [i.Name for i in parameters]&lt;BR /&gt;listParaNamesParaTypes = zip(parametersNames, parameters)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 15:06:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12638109#M6647</guid>
      <dc:creator>studio-a-int</dc:creator>
      <dc:date>2024-03-13T15:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12641788#M6648</link>
      <description>&lt;P&gt;There is no ParameterElement for a BuiltInParameter. If you want its name, you can use &lt;A href="https://apidocs.co/apps/revit/2021.1/ca0f955c-7cfa-e894-c0bc-dfa269aae5b4.htm" target="_blank" rel="noopener"&gt;LabelUtils.GetLabelFor(BuiltInParameter).&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the BuiltInParameter from the integer id in python, try:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;bip = BuiltInParameter(id)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 22:47:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12641788#M6648</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2024-03-14T22:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get BuiltInParameter by Id</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12642423#M6649</link>
      <description>&lt;P&gt;I asked someone personally, this ended up doing the trick:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from System import Enum
param = Enum.ToObject(BuiltInParameter, param_id.Value)&lt;/LI-CODE&gt;&lt;P&gt;Where param_id is the id of the BuiltInParameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe there are easier solutions, but this was the first to work for me&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 07:41:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-builtinparameter-by-id/m-p/12642423#M6649</guid>
      <dc:creator>PieterL_TM</dc:creator>
      <dc:date>2024-03-15T07:41:57Z</dc:date>
    </item>
  </channel>
</rss>

