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

CNX-751: Add Units to reportProperties #389

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

bjoernsteinhagen
Copy link
Contributor

@bjoernsteinhagen bjoernsteinhagen commented Nov 18, 2024

Description & motivation

Changes:

  • Use of Tekla.Structures.Datatype enums for units instead of Tekla.Structures.Drawing. This makes more sense as the Drawing class is more geared to dimension lines, annotations etc. than the model. Here, we also get rid of the FeetsAndInches, CentimetersOrMeters and Automatic enums.
  • hostUnit from Tekla.Structures.Datatype.Distance.CurrentUnitType returns the correct unit set in Settings > Options > Units and decimals, but API returns are always mm. Potential mismatch in model units and report property BUT we append the units to each report property.
  • reportProperties are default mm (or power of). Hence, units appended are hard-coded. Awaiting response and assistance from Tekla. This can be done much better.

Screenshots:

image

  • tl;dr : value extraction and assignment correct. Hard-coded to mm and kg as this is Tekla internal.

More explanation:

  • Tekla API has methods to convert internal units to model units (Settings > Options > Units and decimals). But these methods only apply to Distance and Angle params. Probably more risky to go through series of conversions AND writing additional ones for area, volume etc. than for us to just report everything as internal units.
  • AREA is not the cross-sectional area of the section but some other value. Not our issue though, this is as per Tekla report
  • VOLUME is, however, calculated using the true cross-sectional area multiplied by length. Weird.

Validation of changes:

  • Sending from Basic Steel Model.db1 and checking returned values with generated report.

To Do Before Merge

  • Test with environment in USA @dogukankaratas? To test our theory if internal unit is somehow dependant on environment.

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

Main change is the switch from Tekla.Structures.Drawing to Tekla.Structures.Datatype for units. Problem is, that Settings > Options > Units and decimals don't seem to affect API returns. Will confirm with Tekla team. Rudimentary fix applied for now.
…tproperties' into bjorn/cnx-751-add-units-to-reportproperties
Copy link

linear bot commented Nov 18, 2024

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 8.37%. Comparing base (4215f90) to head (5936541).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev    #389   +/-   ##
=====================================
  Coverage   8.37%   8.37%           
=====================================
  Files        237     237           
  Lines       4704    4704           
  Branches     513     513           
=====================================
  Hits         394     394           
  Misses      4294    4294           
  Partials      16      16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member

@oguzhankoral oguzhankoral left a comment

Choose a reason for hiding this comment

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

Looks good to me! And thanks for saving me trying to understand whats up, nice screenshots! ❤️
if @dogukankaratas doesn't have any objection or catch, we can merge it.

@oguzhankoral oguzhankoral enabled auto-merge (squash) November 19, 2024 09:33
@oguzhankoral oguzhankoral merged commit 8822761 into dev Nov 19, 2024
5 checks passed
@oguzhankoral oguzhankoral deleted the bjorn/cnx-751-add-units-to-reportproperties branch November 19, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants