Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAM_Toolkit: Read factored beam reactions #90

Merged
merged 1 commit into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions RAM_Adapter/CRUD/Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private bool CreateCollection(IEnumerable<Bar> bhomBars)
beam.strSectionLabel = bar.SectionProperty.Name;
// beam.EAnalyzeFlag = EAnalyzeFlag.eAnalyze; deprecated in API
}
catch (Exception ex)
catch
{
CreateElementError("bar", name);
}
Expand Down Expand Up @@ -167,7 +167,7 @@ private bool CreateCollection(IEnumerable<Bar> bhomBars)
column.strSectionLabel = bar.SectionProperty.Name;
column.EAnalyzeFlag = EAnalyzeFlag.eAnalyze;
}
catch (Exception ex)
catch
{
CreateElementError("bar", name);
}
Expand Down Expand Up @@ -335,7 +335,7 @@ private bool CreateCollection(IEnumerable<Panel> bhomPanels)
if (Math.Abs(panel.Normal().Z) < 1)
{ Engine.Reflection.Compute.RecordWarning("Panel " + name + " snapped to level " + ramStory.strLabel + "."); }
}
catch (Exception ex)
catch
{
CreateElementError("panel", name);
}
Expand Down Expand Up @@ -402,7 +402,7 @@ private bool CreateCollection(IEnumerable<Panel> bhomPanels)
}
}
}
catch (Exception ex)
catch
{
CreateElementError("panel", name);
}
Expand Down Expand Up @@ -569,11 +569,11 @@ private bool CreateCollection(IEnumerable<Grid> bhomGrid)
double gridSystemRotation = 0;
string gridSystemLabel = "";
IGridSystem ramGridSystemXY = null;
IGridSystem ramGridSystemRad = null;
IGridSystem ramGridSystemSk = null;
//IGridSystem ramGridSystemRad = null;
//IGridSystem ramGridSystemSk = null;
IModelGrids ramModelGridsXY = null;
IModelGrids ramModelGridsRad = null;
IModelGrids ramModelGridsSk = null;
//IModelGrids ramModelGridsRad = null;
//IModelGrids ramModelGridsSk = null;



Expand Down
25 changes: 10 additions & 15 deletions RAM_Adapter/CRUD/Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ protected override IEnumerable<IBHoMObject> Read(Type type, IList ids)
return ReadPointGravityLoad(ids as dynamic);
else if (type == typeof(RAMLineGravityLoad))
return ReadLineGravityLoad(ids as dynamic);
else if (type == typeof(RAMFactoredEndReactions))
return ReadBeamEndReactions(ids as dynamic);

return null;
}
Expand Down Expand Up @@ -628,34 +630,27 @@ private List<NodeReaction> ReadNodeReaction(List<string> ids = null)

/***************************************************/

private List<Tuple<NodeReaction, NodeReaction>> ReadBeamEndReactions(List<string> ids = null)
private List<RAMFactoredEndReactions> ReadBeamEndReactions(List<string> ids = null)
{
List<Tuple<NodeReaction, NodeReaction>> barEndReactions = new List<Tuple<NodeReaction, NodeReaction>>();
List<RAMFactoredEndReactions> barEndReactions = new List<RAMFactoredEndReactions>();

IModel ramModel = m_RAMApplication.GetDispInterfacePointerByEnum(EINTERFACES.IModel_INT);

List<IBeam> ramBeams = ReadRamBeams(ramModel);

foreach ( IBeam beam in ramBeams)
{
int beamID = beam.lUID;

IAnalyticalResult result = beam.GetAnalyticalResult();

IMemberForces forces = result.GetMaximumComboReactions(COMBO_MATERIAL_TYPE.GRAV_STEEL);

IMemberForce startForce = forces.GetAt(0);
IMemberForce endForce = forces.GetAt(1);

NodeReaction startReaction = startForce.ToBHoMObject();
startReaction.ObjectId = beamID;
NodeReaction endReaction = startForce.ToBHoMObject();
endReaction.ObjectId = beamID;

Tuple<NodeReaction, NodeReaction> bhomEndReactions = Tuple.Create(startReaction, endReaction);
RAMFactoredEndReactions bhomEndReactions = new RAMFactoredEndReactions()
{
ObjectId = beam.lUID,
StartReaction = forces.GetAt(0).ToBHoMObject(),
EndReaction = forces.GetAt(1).ToBHoMObject(),
};

barEndReactions.Add(bhomEndReactions);

}

return barEndReactions;
Expand Down
4 changes: 2 additions & 2 deletions RAM_Engine/Convert/ToBHoM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,8 @@ public static NodeReaction ToBHoMObject(this IMemberForce ramForce)
NodeReaction bhomNodeReaction = new NodeReaction
{
FX = ramForce.dAxial,
FY = ramForce.dShearMajor,
FZ = ramForce.dShearMinor,
FY = ramForce.dShearMinor,
FZ = ramForce.dShearMajor,
MX = ramForce.dTorsion,
MY = ramForce.dMomentMajor,
MZ = ramForce.dMomentMinor
Expand Down
19 changes: 19 additions & 0 deletions RAM_oM/Results/RAMGravityResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class RAMPointGravityLoad : BHoMObject
/***************************************************/
}

/***************************************************/

public class RAMLineGravityLoad : BHoMObject
{
/***************************************************/
Expand All @@ -46,4 +48,21 @@ public class RAMLineGravityLoad : BHoMObject

/***************************************************/
}

/***************************************************/

public class RAMFactoredEndReactions : BHoMObject
{
/***************************************************/
/**** Properties ****/
/***************************************************/

public int ObjectId { get; set; } = 0;
public NodeReaction StartReaction { get; set; } = null;
public NodeReaction EndReaction { get; set; } = null;

/***************************************************/
}

/***************************************************/
}