/// <summary> /// This will estimate the wall's facing direction. Credit for the logic in this node goes to CASE. /// Without the open source tools provided by Don and the CASE team, this node would probably not exist. /// https://github.com/rudderdon/case-apps/blob/master/2017/Case.Directionality/Case.Directionality/Data/clsExternalWalls.vb /// </summary> /// <param name="wall">The wall to calculate facing from.</param> /// <returns name="facingDirection">The estimated facing direction.</returns> public static string Direction(global::Revit.Elements.Element wall) { Autodesk.Revit.DB.Document doc = DocumentManager.Instance.CurrentDBDocument; Autodesk.Revit.DB.Wall internalWall = wall.InternalElement as Autodesk.Revit.DB.Wall; XYZ wallDirection = GetWallDirection(internalWall); return(GetFacingDirection(wallDirection)); }
/// <summary> /// This node will try to check if the walls profile has been modified using the dependent elements method available in Revit 2018.1+ /// </summary> /// <param name="wall">The walls to check.</param> /// <returns name="bool">The result.</returns> /// <search> /// profile, wall /// </search> public static bool HasEditedProfile(global::Revit.Elements.Element wall) { Autodesk.Revit.DB.Document doc = DocumentManager.Instance.CurrentDBDocument; Autodesk.Revit.DB.Wall internalWall = (Autodesk.Revit.DB.Wall)wall.InternalElement; //dependent elements method (available in Revit 2018.1 +) Autodesk.Revit.DB.ElementFilter elemFilter = new ElementIsElementTypeFilter(true); IList <ElementId> elemIds = internalWall.GetDependentElements(elemFilter); //get the elements List <Autodesk.Revit.DB.Element> elems = new List <Element>(elemIds.Select(e => doc.GetElement(e))); //find out if any of the elements are of sketch type return(elems.Any(e => e is Autodesk.Revit.DB.Sketch || e is Autodesk.Revit.DB.SketchPlane)); }
/// <summary> /// This node will try to check if the walls profile has been modified using the dependent elements method available in Revit 2018.1+ /// </summary> /// <param name="wall">The walls to check.</param> /// <returns name="modelCurves">The result.</returns> /// <search> /// profile, wall /// </search> public static global::Revit.Elements.Element[] EditedProfile(global::Revit.Elements.Element wall) { Autodesk.Revit.DB.Document doc = DocumentManager.Instance.CurrentDBDocument; Autodesk.Revit.DB.Element internalWall = wall.InternalElement; //dependent elements method (available in Revit 2018.1 +) Autodesk.Revit.DB.ElementFilter elemFilter = new ElementIsElementTypeFilter(true); IList <ElementId> elemIds = internalWall.GetDependentElements(elemFilter); //get the elements List <Autodesk.Revit.DB.Element> elems = new List <Element>(elemIds.Select(e => doc.GetElement(e))); global::Autodesk.Revit.DB.Element[] internalCurves = elems.Where(e => e is Autodesk.Revit.DB.ModelCurve).ToArray(); global::Revit.Elements.Element[] modelCurves = internalCurves.Select(e => e.ToDSType(true)).ToArray(); return(modelCurves); }