buildingSMART / IFC4.3.x-development

Repository to collect updates to the IFC4.3 Specification
Other
168 stars 84 forks source link

IfcCivilElement doesn't have CorrectTypeAssigned = IfcCivilElementType #583

Open Andrej730 opened 1 year ago

Andrej730 commented 1 year ago

Noticed that in latest .exp schemas (as it was in ifc4 too) IfcCivilElement doesnt have WHERE block with CorrectTypeAssigned = IfcCivilElementType. Seems like a bug.

Current code for IfcCivilElement:

ENTITY IfcCivilElement
 SUBTYPE OF (IfcElement);
END_ENTITY;

ENTITY IfcCivilElementType
 SUBTYPE OF (IfcElementType);
END_ENTITY;

Example for IfcWindow with CorrectTypeAssigned:

ENTITY IfcWindow
 SUBTYPE OF (IfcBuiltElement);
    OverallHeight : OPTIONAL IfcPositiveLengthMeasure;
    OverallWidth : OPTIONAL IfcPositiveLengthMeasure;
    PredefinedType : OPTIONAL IfcWindowTypeEnum;
    PartitioningType : OPTIONAL IfcWindowTypePartitioningEnum;
    UserDefinedPartitioningType : OPTIONAL IfcLabel;
 WHERE
    CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcWindowTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcWindowTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
    CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFC4X3_TC1.IFCWINDOWTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;
aothms commented 1 year ago

These rules are automatically generated, but somehow it seems that the CorrectTypeAssigned rule is only generated for entities having a predefined types (https://github.com/buildingSMART/IFC4.3.x-development/blob/master/code/xmi_document.py#L877) not sure what the reasoning was behind that, maybe none?

Moult commented 1 year ago

@aothms at a guess maybe it was coded alongside the "CorrectPredefinedType" rule so just an oversight? I don't see any reason for the two to be correlated.

aothms commented 1 year ago

I agree, marking this as decided.

SergejMuhic commented 1 year ago

Does it make sense to fix since IfcCivilElement and IfcCivilElementType are deprecated?

Andrej730 commented 1 year ago

Does it make sense to fix since IfcCivilElement and IfcCivilElementType are deprecated?

Could it be that if it's a problem with WHERE block in general then it also affects some other entities?

Andrej730 commented 1 year ago

Same thing for 'IfcDistributionElementType', 'IfcFurnishingElementType' and 'IfcBuiltElementType'

image image image