<?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: C# - Get family parameter and perform if statement with said paramete in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7946116#M50663</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, we use a schedule to see which types are reporting the error. Problem is, if someone new is working and doesnt know to check the schedule for the error they will not know the family is broken. It would be nice to have a dialog box appear once the shared parameter "Error" becomes yes.&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>Thu, 19 Apr 2018 19:54:06 GMT</pubDate>
    <dc:creator>mmorocco</dc:creator>
    <dc:date>2018-04-19T19:54:06Z</dc:date>
    <item>
      <title>C# - Get family parameter and perform if statement with said paramete</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7946045#M50662</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to C# and would like a jumping off point if someone would help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;What i have in my project:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;family: Receptacle&lt;/P&gt;&lt;P&gt;Type: duplex receptacle, quadraplex, (this list can grow)&lt;/P&gt;&lt;P&gt;parameter: Error (yes no)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;what i want:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;A message to appear when error message is true.&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would need the error message to display which family type is containing the error. if more than one type, I would like it to then be a list of error reported types. This would make finding the family type that needs to be fixed easier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am not asking for the huge lines of code (that would be awesome if you did lol) but a jumping off point of what code to use to get family, types, parameters and then initiating a if statement with dialog box in revit.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If anyone can help point me in the right direction, that would be great! thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 19:21:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7946045#M50662</guid>
      <dc:creator>mmorocco</dc:creator>
      <dc:date>2018-04-19T19:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: C# - Get family parameter and perform if statement with said paramete</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7946116#M50663</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, we use a schedule to see which types are reporting the error. Problem is, if someone new is working and doesnt know to check the schedule for the error they will not know the family is broken. It would be nice to have a dialog box appear once the shared parameter "Error" becomes yes.&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>Thu, 19 Apr 2018 19:54:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7946116#M50663</guid>
      <dc:creator>mmorocco</dc:creator>
      <dc:date>2018-04-19T19:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: C# - Get family parameter and perform if statement with said paramete</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7947105#M50664</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you're looking for something like this:&amp;nbsp;&lt;A href="http://thebuildingcoder.typepad.com/blog/2009/05/selecting-model-elements.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2009/05/selecting-model-elements.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, inside the last If block&lt;/P&gt;&lt;PRE&gt;if( null != e.get_Geometry( opt ) )
        {
          elems.Insert( e );
        }&lt;/PRE&gt;&lt;P&gt;you could put something like this:&lt;/P&gt;&lt;PRE&gt;ElementId id = e.GetTypeId();
            ElementType elementType = document.GetElement(id) as ElementType; 
            foreach (Parameter para in elementType.Parameters)
            {
                if (para.Definition.Name == "YourSharedParameter")
                {
                    //do your thing
                }

            }&lt;/PRE&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Ruben&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 07:18:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7947105#M50664</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-20T07:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: C# - Get family parameter and perform if statement with said paramete</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7949044#M50665</link>
      <description>&lt;P&gt;Thank you for the response Ruben!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it seems that code doesn't work with versions after 2009. I tried doing what you said to no avail. Tried the code by itself and received a lot of errors. I bet the code i needs is somewhere in there and needs to be altered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will keep trying to piece things together. If i find an answer I will let you know. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 20:03:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/c-get-family-parameter-and-perform-if-statement-with-said/m-p/7949044#M50665</guid>
      <dc:creator>mmorocco</dc:creator>
      <dc:date>2018-04-20T20:03:44Z</dc:date>
    </item>
  </channel>
</rss>

