Is there a script to capture and export all Revit Model Family ID's

Is there a script to capture and export all Revit Model Family ID's

johnyonemoriantal2
Contributor Contributor
501 Views
4 Replies
Message 1 of 5

Is there a script to capture and export all Revit Model Family ID's

johnyonemoriantal2
Contributor
Contributor

Is there a script to capture and export all Revit Model Family ID's

 

Thank you for your reply or advice..

 

John

 

Email: yonemori.antal@gmail.com

0 Likes
502 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

How about this:

 

FilteredElementCollector coll = new FilteredElementCollector(doc).OfClass(typeof(Family));
List<ElementId> ids = new List<ElementId>();
foreach(Family f in coll)
{
    ids.Add(f.Id);
}

 

regards

Christian

Message 3 of 5

johnyonemoriantal2
Contributor
Contributor

Thank you so much and I will try that--

0 Likes
Message 4 of 5

jeremytammik
Autodesk
Autodesk

Dear John,

 

Thank you for your query.

 

If you would like to try Christian's friendly and helpful suggestion, you might like to try this one as well:

 

 

  ICollection<ElementId> ids
    = new FilteredElementCollector( doc )
      .OfClass( typeof( Family ) )
      .ToElementIds();

 

Christian, might be a useful addition to your toolbox as well  🙂

 

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 5

johnyonemoriantal2
Contributor
Contributor
Thank you so much and would it be ok that you email me?

John
-----
John Yonemori-Antal
Email: yonemori.antal@gmail.com
Phone/Text: 402-430-5418
LinkedIn: https://www.linkedin.com/in/jya402
-----
0 Likes