Autodesk / revit-ifc

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

ENH: Show Fraction for IfcMaterialConstituent #651

Open andydandy74 opened 1 year ago

andydandy74 commented 1 year ago

Enhancement Description

While the IFC4 export supports the IfcMaterialConstituent data type, it is exported without the (optional, I know) Fraction attribute. Having that attribute included would help with material take-offs especially for loadable families.

grafik

Minimal model to reproduce: https://github.com/andydandy74/MyIssues/blob/master/RevitIFC651/130_IFC_IfcMaterialConstituentWithoutFraction.rvt

Tested in IFC4 RVArch

Revit Version

2023.1.x

IFC for Revit Addon Version

23.3.0

Windows Version

10 22H2

eriadam commented 4 months ago

@andydandy74 I would argue, that this is a bug, not a missing feature. Without the fraction, there is no connection between the material layers and their width, making volume calculations impossible.

The calculation of the fraction is completely missing from the code. As the code is currently organised, the total amount of width is not known when the constituent is written to file, so the fraction is simply ignored.

Moreover, the export outputs an arbitrary IFCPHYSICALCOMPLEXQUANTITY+ IFCQUANTITYLENGTH pair, which is only connected to the original material by name. It also messes up the overall quantity calculation, as the widths are now duplicated (#158 + #160 + #164).

#155=IFCMATERIAL('Normalbeton C35/37',$,'Materials');
#156=IFCMATERIAL('Insulation - Fiberglass',$,'Materials');

#157=IFCMATERIALCONSTITUENT('Normalbeton C35/37',$,#155,$,'Materials');
#158=IFCQUANTITYLENGTH('Width',$,$,100.,$);

#159=IFCMATERIALCONSTITUENT('Insulation - Fiberglass',$,#156,$,'Materials');
#160=IFCQUANTITYLENGTH('Width',$,$,200.,$);

#161=IFCMATERIALCONSTITUENTSET('Basic Wall:Sandwich 300mm',$,(#157,#159));
#162=IFCPHYSICALCOMPLEXQUANTITY('Normalbeton C35/37',$,(#158),'Layer',$,$);
#163=IFCPHYSICALCOMPLEXQUANTITY('Insulation - Fiberglass',$,(#160),'Layer',$,$);

#164=IFCQUANTITYLENGTH('Width',$,$,300.,$);

This should look like this maybe:

#155=IFCMATERIAL('Normalbeton C35/37',$,'Materials');
#156=IFCMATERIAL('Insulation - Fiberglass',$,'Materials');
#157=IFCMATERIALCONSTITUENT('Normalbeton C35/37',$,#155, IFCNORMALISEDRATIOMEASURE(0.3),'Materials');
#158=IFCMATERIALCONSTITUENT('Insulation - Fiberglass',$,#156, IFCNORMALISEDRATIOMEASURE(0.7),'Materials');
#159=IFCMATERIALCONSTITUENTSET('Basic Wall:Sandwich 300mm',$,(#157,#158));
#160=IFCQUANTITYLENGTH('Width',$,$,300.,$);
AngelVelezSosa commented 4 months ago

Given that the fraction is optional and not required, I'd have to side with the "feature" argument. That said, the request is noted and we will file an item for it.

parrela commented 4 months ago

REVIT-222071

eriadam commented 4 months ago

@AngelVelezSosa @parrela Thank you! Our team would be very happy to contribute to the project. Could we somehow discuss our possible involvement?