Load multiple Families from a folder and to multiple Revit Models from a folder

@4bimfercesp This is probably not the political correct answer here on the Dynamo forums, but it is quite easy to achieve with an application macro in Revit. Run it without any documents open i Revit.

	public void BatchAddFamilies()
	{	
		string[] files = {@"C:\Users\eibre\Desktop\revit\opendoc\RIB.rvt", @"C:\Users\eibre\Desktop\revit\opendoc\ark.rvt"};
		string[] famFiles = {@"C:\Users\eibre\Desktop\revit\opendoc\hexagon.rfa",@"C:\Users\eibre\Desktop\revit\opendoc\triangle.rfa"};
		foreach (string file1 in files) {
			Document doc1 = Application.OpenDocumentFile(file1);
			Transaction t1 = new Transaction(doc1,"Load family");
			t1.Start();
			foreach(string famFile in famFiles) {
				doc1.LoadFamily(famFile);
			}
			t1.Commit();
			doc1.Close();
		}
	}
4 Likes