Skip to content

Commit

Permalink
GSAGH-401-Allow-concrete-material-with-generic-steel-material-to-be-s…
Browse files Browse the repository at this point in the history
…et-in-model (#553)
  • Loading branch information
tlmnrnhrdt authored Oct 16, 2023
2 parents dd4d546 + a35c237 commit 83c411b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 4 additions & 5 deletions GsaGH/Helpers/Assembly/Properties/Materials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ private string GetConcreteDesignCode(Model model = null) {
if (!material.IsFromApi) {
continue;
}

if (material.ConcreteDesignCodeName != string.Empty &&
material.ConcreteDesignCodeName != GenericConcreteCodeName) {

return material.ConcreteDesignCodeName;
}
}
Expand Down Expand Up @@ -286,15 +286,14 @@ private MaterialType GetMaterialType(GsaMaterial material) {

private string GetSteelDesignCode(Model model = null) {
if (_steelDesignCode == string.Empty) {
// if there is no concrete design code available
// if there is no steel design code available
// try looking for one in the materials created from API objects
foreach (GsaMaterial material in _materials.Values) {
if (!material.IsFromApi) {
continue;
}
if (material.SteelDesignCodeName != string.Empty &&
material.SteelDesignCodeName != GenericSteelCodeName) {


if (material.SteelDesignCodeName != string.Empty) {
return material.SteelDesignCodeName;
}
}
Expand Down
2 changes: 1 addition & 1 deletion GsaGH/Parameters/1_Properties/GsaMaterialFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal static GsaMaterial CreateMaterialFromApi(object standardMaterial, int i
break;

case ConcreteMaterial concreteMaterial:
material = material = new GsaConcreteMaterial(concreteMaterial, true, model.ConcreteDesignCode(), model.SteelDesignCode()) {
material = new GsaConcreteMaterial(concreteMaterial, true, model.ConcreteDesignCode(), model.SteelDesignCode()) {
Id = id,
};
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@ private static GH_Document OpenDocument() {

return Helper.CreateDocument(Path.Combine(path, fileName));
}

[Fact]
public void NoRuntimeErrorTest() {
Helper.TestNoRuntimeMessagesInDocument(Document, GH_RuntimeMessageLevel.Error);
Helper.TestNoRuntimeMessagesInDocument(Document, GH_RuntimeMessageLevel.Warning);
}
}
}

0 comments on commit 83c411b

Please sign in to comment.