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

fix(revit): handles plane origin out of bounds and creating group with no elements exceptions #346

Conversation

clairekuang
Copy link
Member

@clairekuang clairekuang commented Nov 4, 2024

  • creating planes with origin out of bounds will now throw a conversion exception with original stack trace
  • if no objects were sucessfully converted, previously creating a top level group would throw and cover up object exceptions. Now we are just skipping group creating on no successfully converted objects
  • also makes room display values transparent

(exceptions)
before:
image

after:
{BC3DD7BC-ABE5-4C0F-B613-D35E46BE18A8}

{47850F5C-8849-4715-A5D6-3B73DE945F71}

(rooms)
before:
https://latest.speckle.systems/projects/3f895e614f/models/a78e96e0a8@1b0859bb04

after:
https://latest.speckle.systems/projects/3f895e614f/models/a78e96e0a8@347cd6f726

…p when no objects have been successfully converted

also makes room display values transparent
Copy link

linear bot commented Nov 4, 2024

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 8.44%. Comparing base (558a16d) to head (892591b).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
.../Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs 0.00% 19 Missing ⚠️
...Shared/ToHost/Raw/Geometry/PlaneConverterToHost.cs 0.00% 8 Missing ⚠️
...rters.RevitShared/Helpers/DisplayValueExtractor.cs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             dev    #346      +/-   ##
========================================
- Coverage   8.48%   8.44%   -0.04%     
========================================
  Files        237     237              
  Lines       4642    4663      +21     
  Branches     514     514              
========================================
  Hits         394     394              
- Misses      4232    4253      +21     
  Partials      16      16              

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

Comment on lines +28 to +29
if (_elementIdsForTopLevelGroup.Count == 0)
// if no elements were successfully converted, instead of throwing when creating a new group, we should just return and let object conversion exceptions bubble up.
Copy link
Member

Choose a reason for hiding this comment

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

You may need to walk me through this

@@ -209,4 +213,21 @@ private bool SkipGeometry(DB.GeometryObject geomObj, DB.Element element)

return false;
}

// Determines if an element should be sent with invisible display values
private bool SetElementDisplayToTransparent(DB.Element element)
Copy link
Member

Choose a reason for hiding this comment

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

Naming is a bit confusing, could be ShouldSetElement... instead?

Current seems to imply the method does in fact set something.

@@ -8,13 +8,25 @@
namespace Speckle.Converters.RevitShared.ToSpeckle;

public class MeshByMaterialDictionaryToSpeckle
: ITypedConverter<(Dictionary<DB.ElementId, List<DB.Mesh>> target, DB.ElementId parentElementId), List<SOG.Mesh>>
: ITypedConverter<
(Dictionary<DB.ElementId, List<DB.Mesh>> target, DB.ElementId parentElementId, bool makeTransparent),
Copy link
Member

Choose a reason for hiding this comment

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

We really should have a type for this tuple 🙂

@AlanRynne AlanRynne enabled auto-merge (squash) November 5, 2024 16:21
@AlanRynne AlanRynne merged commit ed569cd into dev Nov 5, 2024
3 checks passed
@AlanRynne AlanRynne deleted the claire/cnx-709-civil2revit-at-least-one-element-is-required-parameter-name branch November 5, 2024 16:22
jsdbroughton added a commit that referenced this pull request Nov 5, 2024
* dev:
  supporting ICurves as fallback (#339)
  fix(revit): handles plane origin out of bounds and creating group with no elements exceptions (#346)
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.

2 participants