-
Notifications
You must be signed in to change notification settings - Fork 4
Pull Results Midas Civil NX #404
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
Merged
peterjamesnugent
merged 29 commits into
develop
from
MidasCivil_Toolkit-#402-PullResultsAPI
Jul 21, 2025
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b681a6f
Transfer to Clean branch
EmmaSander 74522ad
Working combined method node result
EmmaSander 797a662
Added Bar Results
EmmaSander 9a146cb
added MeshResult and errors
EmmaSander d2b7193
Fixed sorting by loadCase
EmmaSander b7f9a56
Updated references
EmmaSander a09998d
Update MidasCivil_Adapter.csproj
EmmaSander deb8cb0
Installer error fix test
EmmaSander 1cb3444
Start of updates
EmmaSander c51cb5a
Requested Updates
EmmaSander aa2c1fb
Minor updates
EmmaSander 1af4564
Remove memory reference, case sorting temp. disabled
EmmaSander 13aa4f2
Merge branch 'develop' into MidasCivil_Toolkit-#402-PullResultsAPI
EmmaSander 72a3f1d
reinstated case filter
EmmaSander f0df2fc
Reference Update
EmmaSander a889052
Update MidasCivil_Adapter.csproj
EmmaSander 31fd906
Update MidasCivil_Adapter/PrivateHelpers/AppendCaseTypes.cs
EmmaSander 25291bb
Update MidasCivil_Adapter/PrivateHelpers/ReadResultAPI.cs
EmmaSander 575f309
Update MidasCivil_Adapter/PrivateHelpers/ReadResultAPI.cs
EmmaSander e3ef64d
Update MidasCivil_Adapter/PrivateHelpers/AppendCaseTypes.cs
EmmaSander 81c9539
Requested Updates
EmmaSander 0ac3844
Add GET units for Open in Execute actions
peterjamesnugent 9c53615
Add unit conversion for result reading
peterjamesnugent 48aba28
Updated meshstress and removed double unit conversion
EmmaSander 4aa1660
Fixed bugs added versioning
EmmaSander b5b90c9
Added LayerFiltering for Meshstresses
EmmaSander ac648a7
Add in sigXY
EmmaSander 992d9f4
Formatting and correcting layer positions
EmmaSander 414802f
Revert addition of SigmaXY as it's shear stress in MidasCivil but nor…
peterjamesnugent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| /* | ||
| * This file is part of the Buildings and Habitats object Model (BHoM) | ||
| * Copyright (c) 2015 - 2025, the respective contributors. All rights reserved. | ||
| * | ||
| * Each contributor holds copyright over their respective contributions. | ||
| * The project versioning (Git) records all such contribution source information. | ||
| * | ||
| * | ||
| * The BHoM is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Lesser General Public License as published by | ||
| * the Free Software Foundation, either version 3.0 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * The BHoM is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public License | ||
| * along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>. | ||
| */ | ||
|
|
||
| using BH.Engine.Base; | ||
| using BH.oM.Data.Requests; | ||
| using BH.oM.Structure.Elements; | ||
| using BH.oM.Structure.Requests; | ||
| using BH.oM.Structure.Results; | ||
| using System; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace BH.Adapter.MidasCivil | ||
| { | ||
| public partial class MidasCivilAdapter | ||
| { | ||
| private List<List<object>> FilterMeshLayer(MeshResultRequest request, List<object> resultItems) | ||
| { | ||
| List<List<object>> filteredResult = new List<List<object>>(); | ||
|
|
||
| List<object> upperResult = resultItems.GetRange(0,11); | ||
| List<object> lowerResult = resultItems.ShallowClone(); | ||
| lowerResult.RemoveRange(4, 7); | ||
|
|
||
| switch (request.Layer) | ||
| { | ||
| case MeshResultLayer.Upper: | ||
| filteredResult.Add(upperResult); | ||
| break; | ||
| case MeshResultLayer.Lower: | ||
| filteredResult.Add(lowerResult); | ||
| break; | ||
| case MeshResultLayer.Middle: | ||
| Compute.RecordWarning("Mesh results for the middle layer can not be pulled from Midas Civil. Results for both the top and bottom layer will be returned."); | ||
| filteredResult.Add(upperResult); | ||
| filteredResult.Add(lowerResult); | ||
| break; | ||
| case MeshResultLayer.Maximum: | ||
| List<object> maxValues = resultItems.GetRange(0, 4); | ||
| maxValues.Add(null); | ||
| for (int i = 5; i < 11; i++) | ||
| maxValues.Add(Math.Max(System.Convert.ToDouble(upperResult[i].ToString()), System.Convert.ToDouble(lowerResult[i].ToString()))); | ||
| filteredResult.Add(maxValues); | ||
EmmaSander marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| break; | ||
| case MeshResultLayer.Minimum: | ||
| List<object> minValues = resultItems.GetRange(0, 4); | ||
| minValues.Add(null); | ||
| for (int i = 5; i < 11; i++) | ||
| minValues.Add(Math.Min(System.Convert.ToDouble(upperResult[i].ToString()), System.Convert.ToDouble(lowerResult[i].ToString()))); | ||
| filteredResult.Add(minValues); | ||
| break; | ||
| case MeshResultLayer.AbsoluteMaximum: | ||
| List<object> absMaxValues = resultItems.GetRange(0, 4); | ||
| absMaxValues.Add(null); | ||
| for (int i = 5; i < 11; i++) | ||
| absMaxValues.Add(Math.Max(Math.Abs(System.Convert.ToDouble(upperResult[i].ToString())), Math.Abs(System.Convert.ToDouble(lowerResult[i].ToString())))); | ||
| filteredResult.Add(absMaxValues); | ||
| break; | ||
| case MeshResultLayer.Arbitrary: | ||
| switch (request.LayerPosition) | ||
| { | ||
| case 0: | ||
| filteredResult.Add(lowerResult); | ||
| break; | ||
| case 1: | ||
| filteredResult.Add(upperResult); | ||
| break; | ||
| default: | ||
| Compute.RecordWarning("Mesh results can only be pulled for the top (1) or bottom (0) layer in Midas Civil. Results for both the top and bottom layers will be returned."); | ||
| filteredResult.Add(upperResult); | ||
| filteredResult.Add(lowerResult); | ||
| break; | ||
| } | ||
| break; | ||
| } | ||
| return filteredResult; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.