WriteCurtainCells(CurtainGrid grid, GraphicsStream grStream) { foreach (CurtainCell cell in grid.GetCurtainCells()) { foreach (CurveArray crvArray in cell.CurveLoops) { foreach (Curve crv in crvArray) { grStream.Stream(crv); } } } }
Stream(ArrayList data, CurtainGrid grid) { data.Add(new Snoop.Data.ClassSeparator(typeof(CurtainGrid))); data.Add(new Snoop.Data.Enumerable("Curtain Cells", grid.GetCurtainCells())); data.Add(new Snoop.Data.Enumerable("Mullions", grid.GetMullionIds(), m_activeDoc)); data.Add(new Snoop.Data.Enumerable("Unlocked mullions", grid.GetUnlockedMullionIds(), m_activeDoc)); data.Add(new Snoop.Data.Angle("Grid 1 angle", grid.Grid1Angle)); data.Add(new Snoop.Data.String("Grid 1 justification", grid.Grid1Justification.ToString())); data.Add(new Snoop.Data.Double("Grid 1 offset", grid.Grid1Offset)); data.Add(new Snoop.Data.Angle("Grid 2 angle", grid.Grid2Angle)); data.Add(new Snoop.Data.String("Grid 2 justification", grid.Grid2Justification.ToString())); data.Add(new Snoop.Data.Double("Grid 2 offset", grid.Grid2Offset)); data.Add(new Snoop.Data.Int("Number of panels", grid.NumPanels)); data.Add(new Snoop.Data.Enumerable("Panels", grid.GetPanelIds(), m_activeDoc)); data.Add(new Snoop.Data.Enumerable("Unlocked panels", grid.GetUnlockedPanelIds(), m_activeDoc)); data.Add(new Snoop.Data.Int("Number of U lines", grid.NumULines)); data.Add(new Snoop.Data.Enumerable("U grid lines", grid.GetUGridLineIds(), m_activeDoc)); data.Add(new Snoop.Data.Int("Number of V lines", grid.NumVLines)); data.Add(new Snoop.Data.Enumerable("V grid lines", grid.GetVGridLineIds(), m_activeDoc)); }
/***************************************************/ /**** Public methods ****/ /***************************************************/ public static List <IOpening> CurtainPanels(this CurtainGrid curtainGrid, Document document, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null) { if (curtainGrid == null) { return(null); } List <IOpening> result = new List <IOpening>(); List <Element> panels = curtainGrid.GetPanelIds().Select(x => document.GetElement(x)).ToList(); List <CurtainCell> cells = curtainGrid.GetCurtainCells().ToList(); if (panels.Count != cells.Count) { return(null); } for (int i = 0; i < panels.Count; i++) { FamilyInstance panel = panels[i] as FamilyInstance; if (panel == null || panel.get_BoundingBox(null) == null) { continue; } foreach (PolyCurve pc in cells[i].CurveLoops.FromRevit()) { if (panel.Category.Id.IntegerValue == (int)Autodesk.Revit.DB.BuiltInCategory.OST_Doors) { result.Add(panel.DoorFromRevit(settings, refObjects)); } else { result.Add(panel.WindowFromRevit(settings, refObjects)); } } } return(result); }
/// <summary> /// obtain all the properties of the curtain grid /// </summary> public void ReloadGridProperties() { if (null == m_activeGrid) { if (true == m_myDocument.WallCreated) { m_activeGrid = m_myDocument.CurtainWall.CurtainGrid; } else { return; } } // horizontal grid pattern Transaction act = new Transaction(m_activeDocument, Guid.NewGuid().GetHashCode().ToString()); act.Start(); switch (m_activeGrid.Grid2Justification) { case CurtainGridAlignType.Beginning: m_gridProperties.HorizontalJustification = CurtainGridAlign.Beginning; break; case CurtainGridAlignType.Center: m_gridProperties.HorizontalJustification = CurtainGridAlign.Center; break; case CurtainGridAlignType.End: m_gridProperties.HorizontalJustification = CurtainGridAlign.End; break; default: break; } m_gridProperties.HorizontalAngle = m_activeGrid.Grid2Angle * 180.0 / Math.PI; m_gridProperties.HorizontalOffset = m_activeGrid.Grid2Offset; m_gridProperties.HorizontalLinesNumber = m_activeGrid.NumULines; // vertical grid pattern switch (m_activeGrid.Grid1Justification) { case CurtainGridAlignType.Beginning: m_gridProperties.VerticalJustification = CurtainGridAlign.Beginning; break; case CurtainGridAlignType.Center: m_gridProperties.VerticalJustification = CurtainGridAlign.Center; break; case CurtainGridAlignType.End: m_gridProperties.VerticalJustification = CurtainGridAlign.End; break; default: break; } m_gridProperties.VerticalAngle = m_activeGrid.Grid1Angle * 180.0 / Math.PI; m_gridProperties.VerticalOffset = m_activeGrid.Grid1Offset; m_gridProperties.VerticalLinesNumber = m_activeGrid.NumVLines; // other data m_gridProperties.PanelNumber = m_activeGrid.NumPanels; m_gridProperties.UnlockedPanelsNumber = m_activeGrid.GetUnlockedPanelIds().Count; m_gridProperties.CellNumber = m_activeGrid.GetCurtainCells().Count; if (0 != m_activeGrid.GetMullionIds().Count) { m_gridProperties.MullionsNumber = m_activeGrid.GetMullionIds().Count; m_gridProperties.UnlockedmullionsNumber = m_activeGrid.GetUnlockedMullionIds().Count; } act.Commit(); }
private void WriteCurtainCells(CurtainGrid grid, GraphicsStream grStream) { foreach (CurtainCell cell in grid.GetCurtainCells()) { foreach (CurveArray crvArray in cell.CurveLoops) { foreach (Curve crv in crvArray) { grStream.Stream(crv); } } } }