/***************************************************/ private List <IWall> ReadRamWalls(IModel ramModel) { //Get stories IStories ramStories = ramModel.GetStories(); int numStories = ramStories.GetCount(); List <IWall> allRamWalls = new List <IWall>(); // Get all walls on each story for (int i = 0; i < numStories; i++) { //Get Walls IWalls ramWalls = ramStories.GetAt(i).GetWalls(); int numWalls = ramWalls.GetCount(); // Convert Walls for (int j = 0; j < numWalls; j++) { IWall ramWall = ramWalls.GetAt(j); allRamWalls.Add(ramWall); } } return(allRamWalls); }
/***************************************************/ /**** Private methods ****/ /***************************************************/ private List <Panel> ReadPanels(List <string> ids = null) { //Get dictionary of surface properties with ids Dictionary <string, ISurfaceProperty> bhomProperties = ReadISurfaceProperties().ToDictionary(x => GetAdapterId(x).ToString()); //Implement code for reading panels List <Panel> bhomPanels = new List <Panel>(); //Get stories IStories IStories = m_Model.GetStories(); int numStories = IStories.GetCount(); // Get all elements on each story for (int i = 0; i < numStories; i++) { //Get Walls IWalls IWalls = IStories.GetAt(i).GetWalls(); int numWalls = IWalls.GetCount(); // Convert Walls for (int j = 0; j < numWalls; j++) { IWall IWall = IWalls.GetAt(j); Panel Panel = BH.Adapter.RAM.Convert.ToBHoMObject(IWall); bhomPanels.Add(Panel); } //Get Floors IStory IStory = IStories.GetAt(i); IFloorType IFloorType = IStory.GetFloorType(); IDecks IDecks = IFloorType.GetDecks(); int IStoryUID = IStory.lUID; int numDecks = IDecks.GetCount(); if (numDecks > 0) { // Convert Floors for (int j = 0; j < numDecks; j++) { IDeck IDeck = IDecks.GetAt(j); Panel panel = BH.Adapter.RAM.Convert.ToBHoMObject(IDeck, m_Model, IStoryUID); if (panel != null) { ISurfaceProperty bhProp = new ConstantThickness(); bhomProperties.TryGetValue(IDeck.lPropID.ToString(), out bhProp); if (bhProp != null) { panel.Property = bhProp; } else { Engine.Base.Compute.RecordWarning($"Could not get property for floor with RAM lUID = {IDeck.lUID}"); } bhomPanels.Add(panel); } } } else { BH.Engine.Base.Compute.RecordWarning("This story has no slab edges defined. IStoryUID: " + IStoryUID); break; } } return(bhomPanels); }