Search in sources :

Example 1 with IfcPhysicalQuantity

use of org.bimserver.models.ifc2x3tc1.IfcPhysicalQuantity in project BIMserver by opensourceBIM.

the class IfcUtils method getIfcQuantityVolume.

public static Double getIfcQuantityVolume(IfcProduct ifcProduct, String name) {
    for (IfcRelDefines ifcRelDefines : ifcProduct.getIsDefinedBy()) {
        if (ifcRelDefines instanceof IfcRelDefinesByProperties) {
            IfcRelDefinesByProperties ifcRelDefinesByProperties = (IfcRelDefinesByProperties) ifcRelDefines;
            IfcPropertySetDefinition propertySetDefinition = ifcRelDefinesByProperties.getRelatingPropertyDefinition();
            if (propertySetDefinition instanceof IfcElementQuantity) {
                if (propertySetDefinition.getName().equals("BaseQuantities")) {
                    IfcElementQuantity ifcElementQuantity = (IfcElementQuantity) propertySetDefinition;
                    for (IfcPhysicalQuantity ifcPhysicalQuantity : ifcElementQuantity.getQuantities()) {
                        if (ifcPhysicalQuantity instanceof IfcQuantityVolume) {
                            return ((IfcQuantityVolume) ifcPhysicalQuantity).getVolumeValue();
                        }
                    }
                }
            }
        }
    }
    return null;
}
Also used : IfcQuantityVolume(org.bimserver.models.ifc2x3tc1.IfcQuantityVolume) IfcElementQuantity(org.bimserver.models.ifc2x3tc1.IfcElementQuantity) IfcPhysicalQuantity(org.bimserver.models.ifc2x3tc1.IfcPhysicalQuantity) IfcRelDefinesByProperties(org.bimserver.models.ifc2x3tc1.IfcRelDefinesByProperties) IfcPropertySetDefinition(org.bimserver.models.ifc2x3tc1.IfcPropertySetDefinition) IfcRelDefines(org.bimserver.models.ifc2x3tc1.IfcRelDefines)

Aggregations

IfcElementQuantity (org.bimserver.models.ifc2x3tc1.IfcElementQuantity)1 IfcPhysicalQuantity (org.bimserver.models.ifc2x3tc1.IfcPhysicalQuantity)1 IfcPropertySetDefinition (org.bimserver.models.ifc2x3tc1.IfcPropertySetDefinition)1 IfcQuantityVolume (org.bimserver.models.ifc2x3tc1.IfcQuantityVolume)1 IfcRelDefines (org.bimserver.models.ifc2x3tc1.IfcRelDefines)1 IfcRelDefinesByProperties (org.bimserver.models.ifc2x3tc1.IfcRelDefinesByProperties)1