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

RepresentationInstances: IFC support #1029

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

katehryhorenko
Copy link
Contributor

@katehryhorenko katehryhorenko commented Sep 19, 2023

BACKGROUND:
In prev. PR I added multiple representations. So GeometricElement now has list of RepresentationInstances. This PR contains changes inside IFC serializer that allow to include all SolidRepresentations that are marked as "default" to IFC

DESCRIPTION:

  • Small refactoring: AddSolidOperationToDocument method encapsulates the old logic of adding the solid operation to IFC document
  • All SolidOperations that are marked as "Default" are serialized to IFC

TESTING:

  • I tested it with Unicorn function. I created a test with IFC creation. If you want, I can share Unicorn function with you. But you can create any function and create RepresentationInstances instead of Representation inside UpdateRepresentations method.

REQUIRED:

  • All changes are up to date in CHANGELOG.md.

COMMENTS:

  • Any other notes.

This change is Reviewable

Copy link
Contributor

@anthonie-kramer anthonie-kramer left a comment

Choose a reason for hiding this comment

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

Just one comment about possible null value, but :lgtm_strong::

Reviewed all commit messages.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @katehryhorenko)


Elements.Serialization.IFC/src/Serialization/IFC/IFCElementExtensions.cs line 97 at r1 (raw file):

                                foreach (var geom in ifcRepresentations)
                                {
                                    var styledItem = new IfcStyledItem(geom, styleAssignments[representationInstance.Material.Id], null);

Can the Material be null in RepresentationInstance? If so, we should use a TryGetValue() for the representationInstance.Material?.Id

Copy link
Contributor Author

@katehryhorenko katehryhorenko left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @anthonie-kramer)


Elements.Serialization.IFC/src/Serialization/IFC/IFCElementExtensions.cs line 97 at r1 (raw file):

Previously, anthonie-kramer (Anthonie Kramer) wrote…

Can the Material be null in RepresentationInstance? If so, we should use a TryGetValue() for the representationInstance.Material?.Id

Done.

# Conflicts:
#	Elements.Serialization.IFC/src/Serialization/IFC/IFCElementExtensions.cs
@katehryhorenko katehryhorenko merged commit 4e2748e into master Sep 26, 2023
2 checks passed
@katehryhorenko katehryhorenko deleted the multiple-representations-two branch September 26, 2023 14:47
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.

None yet

2 participants