Autodesk / revit-ifc

IFC for Revit and Navisworks (2019+)
483 stars 194 forks source link

Properties duplicated on occurrences when already specified on type #495

Open Moult opened 2 years ago

Moult commented 2 years ago

I've noticed during exports that when a property exists on a type, I can also see it on the occurrence despite the value being identical. This seems to be invalid: IFC specifies that properties shall be inherited from the type so there is no need to repeat them.

AngelVelezSosa commented 2 years ago

We don't duplicate it on purpose (in fact, I don't think we ever do it, which is why I'm curious). Do you always see this or in specific circumstances? Do you have a small sample?

jmirtsch commented 2 years ago

It's a recent change where type properties are not duplicated on instances isn't it? My understanding is that this duplication has been the behaviour for some time. This relates to my recent report, as there is no relating type to an IfcSystem, that some revit system type parameters are no longer exported to IFC.

AngelVelezSosa commented 2 years ago

Well, the "correct" behavior is supposed to be:

  1. Anything that can get a type entity in IFC and has a type in Revit, does.
  2. Anything that doesn't have a type in Revit, doesn't.
  3. If there is an instance and a type, the instance gets instance properties and the type gets type properties.
  4. If there is an instance and no type, the instance gets instance and type properties (assuming there was a type in Revit). Given that this isn't 1-1 Revit-IFC, there is the potential for mistakes. @jmirtsch can you cross-link your report so we can make sure to check both at once (ideally with a sample file for this case)?
Moult commented 2 years ago

The sample file I provided in #493 has a beam where the Pset_BeamCommon IsExternal is repeated on the type and the occurrence, both with the same value of "False". Also, the IfcCovering repeats the Pset_CoveringCommon ThermalTransmittance value on the type and occurrence. There are probably more, I just randomly clicked a couple of elements and those where what I found.

AngelVelezSosa commented 2 years ago

Ah, that's different. Those are Pset_ property sets. I'm confused about what the behavior should be. Doesn't psetbeamcommon apply to both instance and type? Wouldn't it therefore be potentially repeated? Are you saying that pset should only apply to the beam or the type?

AngelVelezSosa commented 2 years ago

Beam instance or type, sorry, typing on phone.

Moult commented 2 years ago

If the property is inherited from the type, there is no need to define it twice.

AngelVelezSosa commented 2 years ago

OK, that is an interesting case. IsExternal in Revit is a calculated parameter, in the case that if it isn't supplied, in some cases it will be determined. But I think what we can do is that calculated parameters shouldn't ask the type for information; if both the instance and type are being exported, and we have a calculated parameter, then it should only be calculated for the instance and type if they have different values (e.g., a wall type is external but an individual wall that uses that type is internal). So I would say that this is applicable to a specific subset of Pset_*Common parameters. I'll file an issue.