<?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 FamilySymbol from Elements in ActiveView in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658749#M23425</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7164218"&gt;@ridaabderrahmane&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7018260"&gt;@guillain.jolivet&lt;/a&gt;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp; . Thank you for your help but I'm still getting null values.&lt;/P&gt;&lt;P&gt;This is what I'm trying inside a Macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//Get Document
Document doc = this.ActiveUIDocument.Document;
UIApplication uiapp = new UIApplication(Application);
UIDocument uidoc = this.ActiveUIDocument;
//FOUNDATION TYPES
IList&amp;lt;ElementId&amp;gt; object_typeIds_in_view = new FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_StructuralFoundation).WhereElementIsNotElementType().ToElements().Select(el=&amp;gt;el.GetTypeId()).Distinct().ToList();
IList&amp;lt;Element&amp;gt; object_types_in_view = new FilteredElementCollector(doc, object_typeIds_in_view).WhereElementIsNotElementType().ToElements();
//Show result
string message;
message = "Name of Types : ";
foreach(Element elem in object_types_in_view)
	message += "\n" + elem.Name;
TaskDialog.Show("Result","Number of elements : " + object_types_in_view.Count() + "\n" + message);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also the taskDialog within my model, which is a Central Model, not linked models.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 18:43:40 GMT</pubDate>
    <dc:creator>luisdavid.mena</dc:creator>
    <dc:date>2021-09-30T18:43:40Z</dc:date>
    <item>
      <title>Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10656305#M23418</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;I'm trying to get FamilySymbol from an active 3D View using FilteredElementCollector. B&lt;U&gt;ut I'm getting null values.&lt;/U&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;FilteredElementCollector elements = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(FamilySymbol)).OfCategory(BuiltInCategory.OST_StructuralFoundation);&lt;/LI-CODE&gt;&lt;P&gt;Attached is the screenshot of the elements(StructuralFoundation) that I'm trying to get.&lt;BR /&gt;Any help would be very appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 21:24:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10656305#M23418</guid>
      <dc:creator>luisdavid.mena</dc:creator>
      <dc:date>2021-09-29T21:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10656324#M23419</link>
      <description>&lt;P&gt;FamilySymbols are an ElementType and as such don't appear in the view themselves.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filter instead for FamilyInstances then from there use Element.GetTypeId on the resulting elements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could also use FamilyInstance.Symbol if you've cast the elements returned from the filter to FamilyInstance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 21:37:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10656324#M23419</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-09-29T21:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10656339#M23420</link>
      <description>&lt;PRE&gt;FilteredElementCollector familySymbols = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(FamilySymbol)).OfCategory(BuiltInCategory.OST_StructuralFoundation).Cast&amp;lt;FamilyInstance&amp;gt;().Select(e=&amp;gt;e.Symbol).ToList():;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Sep 2021 21:50:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10656339#M23420</guid>
      <dc:creator>ridaabderrahmane</dc:creator>
      <dc:date>2021-09-29T21:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10657319#M23421</link>
      <description>&lt;P&gt;I'm actually working on something like that and didn't find out how to do it with just a FilteredElementCollector...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I find every single type name of structural foundation in the view, then i collect every StructuralFoundation element type in the document and iterate it and compare the ElementType name with type names i found in the view. And add it to a new list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;List&amp;lt;string&amp;gt; object_types_in_view = new FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_StructuralFoundation).WhereElementIsNotElementType().ToElements().Select(el =&amp;gt; el.Name).Distinct().ToList();

object_types_in_view.Sort();

ICollection&amp;lt;Element&amp;gt; object_types = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralFoundation).WhereElementIsElementType().ToElements();

List&amp;lt;ElementType&amp;gt; Types_in_view = new List&amp;lt;ElementType&amp;gt;();

foreach (ElementType el_ty in object_types)
{
    if (object_types_in_view.Contains(el_ty.Name))
    {
        Types_in_view.Add(el_ty);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;It's maybe not the best way to achieve it but it works!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 09:25:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10657319#M23421</guid>
      <dc:creator>guillain.jolivet</dc:creator>
      <dc:date>2021-09-30T09:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10657431#M23422</link>
      <description>&lt;P&gt;If you incorporate GetTypeId you can avoid dealing with strings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;IList&amp;lt;ElementId&amp;gt; object_typeIds_in_view = new FilteredElementCollector(IntDoc, IntDoc.ActiveView.Id)
				.OfCategory(BuiltInCategory.OST_StructuralFoundation)
				.WhereElementIsNotElementType()
				.ToElements().Select(el =&amp;gt; el.GetTypeId()).Distinct().ToList();

IList&amp;lt;Element&amp;gt; object_types_in_view 
     = new FilteredElementCollector(IntDoc, object_typeIds_in_view)						 
                .WhereElementIsElementType().ToElements();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 10:25:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10657431#M23422</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-09-30T10:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658528#M23423</link>
      <description>Thank you !&lt;BR /&gt;But I don't want a list by every instance. What I need is a list of the existing types in the model. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Thu, 30 Sep 2021 16:48:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658528#M23423</guid>
      <dc:creator>luisdavid.mena</dc:creator>
      <dc:date>2021-09-30T16:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658557#M23424</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8626015"&gt;@luisdavid.mena&lt;/a&gt;I don't understand. Both solutions give you family types existing in the active view. It's not what you are looking for?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:00:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658557#M23424</guid>
      <dc:creator>guillain.jolivet</dc:creator>
      <dc:date>2021-09-30T17:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658749#M23425</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7164218"&gt;@ridaabderrahmane&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7018260"&gt;@guillain.jolivet&lt;/a&gt;,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp; . Thank you for your help but I'm still getting null values.&lt;/P&gt;&lt;P&gt;This is what I'm trying inside a Macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//Get Document
Document doc = this.ActiveUIDocument.Document;
UIApplication uiapp = new UIApplication(Application);
UIDocument uidoc = this.ActiveUIDocument;
//FOUNDATION TYPES
IList&amp;lt;ElementId&amp;gt; object_typeIds_in_view = new FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_StructuralFoundation).WhereElementIsNotElementType().ToElements().Select(el=&amp;gt;el.GetTypeId()).Distinct().ToList();
IList&amp;lt;Element&amp;gt; object_types_in_view = new FilteredElementCollector(doc, object_typeIds_in_view).WhereElementIsNotElementType().ToElements();
//Show result
string message;
message = "Name of Types : ";
foreach(Element elem in object_types_in_view)
	message += "\n" + elem.Name;
TaskDialog.Show("Result","Number of elements : " + object_types_in_view.Count() + "\n" + message);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also the taskDialog within my model, which is a Central Model, not linked models.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 18:43:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658749#M23425</guid>
      <dc:creator>luisdavid.mena</dc:creator>
      <dc:date>2021-09-30T18:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get FamilySymbol from Elements in ActiveView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658955#M23426</link>
      <description>&lt;P&gt;Hello. I'm sorry. It was just that in the second collector I used WhereElementIsNotElementType() instead of WhereElement&lt;STRONG&gt;Is&lt;/STRONG&gt;ElementType() &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;The topic is solved !&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 19:35:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-familysymbol-from-elements-in-activeview/m-p/10658955#M23426</guid>
      <dc:creator>luisdavid.mena</dc:creator>
      <dc:date>2021-09-30T19:35:56Z</dc:date>
    </item>
  </channel>
</rss>

