/***************************************************/ /**** Private methods ****/ /***************************************************/ private List <NodeReaction> ReadNodeReaction(List <string> ids = null) { //Implement code for reading Node Reactions List <NodeReaction> bhomNodeReactions = new List <NodeReaction>(); IModel ramModel = m_Application.GetDispInterfacePointerByEnum(EINTERFACES.IModel_INT); ILoadCases ramLoadCases = ramModel.GetLoadCases(EAnalysisResultType.RAMFrameResultType); //Get IWalls List <IWall> allRamWalls = ReadRamWalls(ramModel); // Adding node reactions per wall per loadcase, this is node reactions at btm of wall foreach (IWall wall in allRamWalls) { for (int i = 0; i < ramLoadCases.GetCount(); i++) { //Get Loadcases ILoadCase ramLoadCase = ramLoadCases.GetAt(i); IPointLoads wallNodeForces = wall.GetNodeForcesAtEdge(EAnalysisResultType.RAMGravityResultType, ramLoadCase.lUID, EEdge.eBottomEdge); for (int j = 0; j < wallNodeForces.GetCount(); j++) { //Get Node Forces IPointLoad wallNodeForce = wallNodeForces.GetAt(j); NodeReaction bhomNodeReaction = wallNodeForce.ToBHoMObject(ramLoadCase); bhomNodeReactions.Add(bhomNodeReaction); } } } return(bhomNodeReactions); }
/***************************************************/ public static LoadCombination ToBHoMObject(IModel ramModel, ILoadCombination ramLoadCombination) { LoadCombination loadCombination = new LoadCombination(); loadCombination.Name = ramLoadCombination.strDisplayString; loadCombination.Number = ramLoadCombination.lLabelNo; ILoadCombinationTerms iLoadCombinationTerms = ramLoadCombination.GetLoadCombinationTerms(); for (int i = 0; i < iLoadCombinationTerms.GetCount(); i++) { //Get LoadCombination Cases and Factors ILoadCombinationTerm iLoadCombinationTerm = iLoadCombinationTerms.GetAt(i); int caseID = iLoadCombinationTerm.lLoadCaseID; ILoadCases iLoadCases = ramModel.GetLoadCases(EAnalysisResultType.RAMFrameResultType); ILoadCase iLoadCase = iLoadCases.Get(caseID); //Convert Loadcase from RAM to BHoM Loadcase bhomLoadcase = ToBHoMObject(iLoadCase); //Add dict for load factor and loadcase loadCombination.LoadCases.Add(new Tuple <double, ICase>(iLoadCombinationTerm.dFactor, bhomLoadcase)); } return(loadCombination); }
/***************************************************/ /**** Private methods ****/ /***************************************************/ private List <Loadcase> ReadLoadCase(List <string> ids = null) { //Implement code for reading loadcases List <Loadcase> bhomLoadCases = new List <Loadcase>(); ILoadCases ILoadCases = m_Model.GetLoadCases(EAnalysisResultType.RAMFrameResultType); for (int i = 0; i < ILoadCases.GetCount(); i++) { //Get Loadcases ILoadCase LoadCase = ILoadCases.GetAt(i); Loadcase bhomLoadcase = BH.Adapter.RAM.Convert.ToBHoMObject(LoadCase); bhomLoadCases.Add(bhomLoadcase); } return(bhomLoadCases); }