public static void IntegrateEnergyResults(UIDocument uidoc, Document doc, IDFFile.Building Bui, string massName, Dictionary <string, double[]> resultsDF, Dictionary <string, Element> masses) { Bui.AssociateProbabilisticEnergyPlusResults(resultsDF); View3D v1 = (new FilteredElementCollector(doc).OfClass(typeof(View3D)).Cast <View3D>()).First(v => v.Name.Contains("Op - " + massName)); using (Transaction tx = new Transaction(doc, "Simplified EP")) { uidoc.ActiveView = v1; tx.Start(); View3D v2 = View3D.CreateIsometric(doc, v1.GetTypeId()); v2.Name = "SimplifiedEP-" + massName; IEnumerable <Element> allElements = new FilteredElementCollector(doc).WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_Mass); allElements = allElements.Concat(new FilteredElementCollector(doc).WherePasses(new ElementClassFilter(typeof(CurveElement)))); v2.HideElements(allElements.Select(e => e.Id).ToList()); v2.UnhideElements(new List <ElementId>() { masses[massName].Id }); tx.Commit(); uidoc.ActiveView = v2; } }
/// <summary> /// /// </summary> /// <param name="app"></param> /// <param name="view3D"></param> /// <returns></returns> private static Revit.Element CloneElement(Autodesk.Revit.UI.UIApplication app, View3D view3D) { XYZ viewDir = view3D.ViewDirection; View3D view3DClone = View3D.CreateIsometric(app.ActiveUIDocument.Document, view3D.GetTypeId()); Utils.ParamUtil.SetParameters(view3DClone.Parameters, view3D.Parameters); return(view3DClone); }
/// <summary> /// /// </summary> /// <param name="app"></param> /// <param name="view3D"></param> /// <returns></returns> private static Revit.Element CloneElement( Autodesk.Revit.UI.UIApplication app, View3D view3D ) { XYZ viewDir = view3D.ViewDirection; View3D view3DClone = View3D.CreateIsometric( app.ActiveUIDocument.Document, view3D.GetTypeId() ); Utils.ParamUtil.SetParameters( view3DClone.Parameters, view3D.Parameters ); return view3DClone; }