Skip to content

Conversation

@EmmaSander
Copy link
Contributor

@EmmaSander EmmaSander commented Apr 16, 2025

NOTE: Depends on

Issues addressed by this PR

Closes #402

Adds support for pulling back results through the Midas Civil API.

Test files

https://burohappold.sharepoint.com/:u:/s/BHoM/EbUDO6o8TgZCs-2O0Zo4yYwB6c52_vfgJ9XVOv3-JyWqQg?e=Ll74Uv

Changelog

  • Created a new helper method that formats and breaks down API result requests and responses.
  • Redirected ResultRequests to the new helper method for version NX.
  • Added new conversion methods for results based on the new format.
  • Added versioning to GetObjectId and GetLoadcaseID to ensure they have the right format for filtering requests.
  • Added errors for empty or bad requests.
  • Added support for the BarDivision filter
  • Added 9.5.5.nx versioning
  • Added layer filter

Additional comments

Additional filter options by part/position/division for bars and meshes not yet added

@EmmaSander EmmaSander added the type:feature New capability or enhancement label Apr 16, 2025
@EmmaSander EmmaSander self-assigned this Apr 16, 2025
@peterjamesnugent
Copy link
Member

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Apr 16, 2025

@peterjamesnugent to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@EmmaSander
Copy link
Contributor Author

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Apr 17, 2025

@EmmaSander to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@EmmaSander
Copy link
Contributor Author

@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Apr 17, 2025

@EmmaSander to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Apr 17, 2025

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@bhombot-ci
Copy link

bhombot-ci bot commented Apr 17, 2025

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@bhombot-ci
Copy link

bhombot-ci bot commented Apr 17, 2025

The check project-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few changes related to ids for obects and loadcases, few method naming ones too.

@EmmaSander
Copy link
Contributor Author

@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Jun 16, 2025

@EmmaSander to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a commit that adds unit conversion - I think this needs a bit more work so lets not merge in for 8.2.

@peterjamesnugent
Copy link
Member

@BHoMBot check core

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 4, 2025

@peterjamesnugent to confirm, the following actions are now queued:

  • check core

@peterjamesnugent peterjamesnugent self-requested a review July 9, 2025 09:03
Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the script so it's easier to verify values, can we make sure that scripts are laid out to make it as easy as possible to check in the future.

Changes required:

  • When you provide a Case that does not exist, it raises a warning and does not apply a filter but when you provide a Node that does not exist it raises an error. Can we make sure it's consistent please, my preference would be if specific Case or ObjectId cannot be found, run the Pull without a filter.
  • When you try to pull a NodeReaction with an ObjectId that does not have a support, you get an exception. This needs to be considered with the consistency above - again my preference would be it just pulls all valid NodeResult and raise a warning that the ObjectId provided is not a support.
  • Add to the warning message when you provide a non-existent Cases filter that MidasCivil Loadcase and LoadCombination do not have ids and therefore need to use the name.
  • For BarStress and BarForce, the DivisionType from BarResultRequest does not appear to be considered. I always get division at quarter points. Again, MidasCivil may not support anything beyond ExtemeValues and quarter points, but we should make the user aware in a warning.
  • For BarStress the Bend (+y), Bend (-y) and Bend(+z), Bend(z-) do not align with BendingY_Top, BendingY_Bot, BendingZ_Top, BendingZ_Bot. For example, Bar 11, Pedestrian, at position 0 has these values inverted. Please check.
  • BarForce My and Mz are inverted, is this correct?
  • MeshForce does not look like you've used the NodeId correctly as all entries have the same result in the BHoM, but have differing results in Midas (see Element 78);
  • MeshStress I would not report TXX and TYY as we only know TXY and it would not match the descriptions for the properties.
  • I think you are correct not to report Principal_1_2;
  • VonMisesStress you have in stored the stress in the Moment property.

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested using the scripts, happy changes have been made from previous review.

Few minor changes below and the layering to be sorted on the MeshStress.

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with the values apart from MeshStress not getting any results back there. Otherwise, the layering and position works well.

@peterjamesnugent
Copy link
Member

@BHoMBot check complaince
@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 18, 2025

@peterjamesnugent to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with this now, reverted the changes on MeshStress as per my comment.

@peterjamesnugent
Copy link
Member

@BHoMBot check core
@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Jul 19, 2025

@peterjamesnugent to confirm, the following actions are now queued:

  • check core
  • check ready-to-merge

Copy link

@martin-rivas-quarneti martin-rivas-quarneti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked the adapter in Midas NX version 9.5.5. Analysis output match the results pulled shown in the script.

@peterjamesnugent peterjamesnugent merged commit 9c4beab into develop Jul 21, 2025
10 checks passed
@peterjamesnugent peterjamesnugent deleted the MidasCivil_Toolkit-#402-PullResultsAPI branch July 21, 2025 15:56
@BHoMBot BHoMBot mentioned this pull request Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pull back results API

4 participants