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

Implement missing Partials in IFC4x3 schema #600

Open
andyward opened this issue Jan 30, 2025 · 4 comments
Open

Implement missing Partials in IFC4x3 schema #600

andyward opened this issue Jan 30, 2025 · 4 comments

Comments

@andyward
Copy link
Member

A number of 'Partial' class extensions are missing from the IFC4x3 schema. E.g. IfcSitePartial, IfcCompoundPlaneAngleMeasurePartial etc.

Consider if these could be better implemented as extensions on the cross schema interfaces

@WalchAndreas
Copy link

Hi,

while porting our application to support Ifc4x3, we encountered problems regarding Properties / Quantities.
The IIfcObject interface fails to provide PhysicalSimpleQuantities / PropertySets / GetElementQuantity() ....

Trying to resolve queries for IIfcProperty, we tested the instance to specific IfcObject (Ifc2x3.Kernel / Xbim.Ifc4.Kernel / Xbim.Ifc4x3.Kernel) implementation, which seems not promising for future versions.

Do you have recommendations to resolve this issue?

@andyward
Copy link
Member Author

Naively we just need to implement (copy - paste) the Partial classes from IFC4 in IFC4x3 schema. E.g. For PhysicalSimpleQuantities etc in IFC4 & 2x3 we have these implemented as helper methods in IfcObjectPartial

But I actually think the better pattern (to save duplicating code) will be to implement as Extension-methods on the 'common' IFC4 interfaces so they can be defined once and used on all schemas. It may have made sense pragmatically to copy when we had 2 schemas but with 3+ it's feels like overhead.

You could even implement these ExtensionMethods yourself as a stop gap if it's blocking you - or send us a PR and we'll incorporate officially.

@WalchAndreas
Copy link

WalchAndreas commented Feb 3, 2025

Has this been resolved with your last commit?

Regarding GetPropertySets:
This implementation relies on "IsDefinedBy" and returns all instance properties.
To access the related ObjectType properties, the query "IsTypedBy" is necessary.

To show all Properties, these two queries have to be combined, while the instance properties should overrule the type properties.

Would it make sense to provide this query as an extension?

In the Ifc2x3 implementation, the Properties were queried by using the "IsDefinedByProperties" extensions.
Is this equivalent to Ifc4.x?

@andyward
Copy link
Member Author

andyward commented Feb 4, 2025

It's work in progress but feel free to try out. Aiming to get it into develop this week.

I was hoping to implement more through extension methods - but that will have to wait 'til C#14 since we need Extension properties to implement universally - plus it would be a breaking change. But I've generally tried to centralise the partial logic to we're re-using logic.

An extension method to get properties accounting for Type inheritance, and Instance override makes sense. I suspect we have one somewhere and just need to repurpose for cross-schema. However it's also potentially an expensive operation to coalesce this data so we'd need to be sure we don't impact simple use cases.

Regarding Ifc2x3s IsDefinedByProperties implementation being different: IFC4 changed the IsDefined relationship:

IFC4 CHANGE The data type has been changed from IfcRelDefines to IfcRelDefinesByProperties with upward compatibility for file based exchange.

So IsDefinedByProperties is technically redundant IFC4+ as it's the same as IsDefined. But we do need to check that when dealing with IFC2x3 cross-schema we're only looking at IfcReldefinesByProperties. Good spot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants