Search in sources :

Example 1 with IfcElementQuantity

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

the class IfcUtils method listElementQuantities.

public static List<String> listElementQuantities(IfcProduct ifcProduct) {
    List<String> list = new ArrayList<>();
    for (IfcRelDefines ifcRelDefines : ifcProduct.getIsDefinedBy()) {
        if (ifcRelDefines instanceof IfcRelDefinesByProperties) {
            IfcRelDefinesByProperties ifcRelDefinesByProperties = (IfcRelDefinesByProperties) ifcRelDefines;
            IfcPropertySetDefinition propertySetDefinition = ifcRelDefinesByProperties.getRelatingPropertyDefinition();
            if (propertySetDefinition instanceof IfcElementQuantity) {
                IfcElementQuantity ifcElementQuantity = (IfcElementQuantity) propertySetDefinition;
                list.add(ifcElementQuantity.getName());
            }
        }
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) IfcElementQuantity(org.bimserver.models.ifc2x3tc1.IfcElementQuantity) IfcRelDefinesByProperties(org.bimserver.models.ifc2x3tc1.IfcRelDefinesByProperties) IfcPropertySetDefinition(org.bimserver.models.ifc2x3tc1.IfcPropertySetDefinition) IfcRelDefines(org.bimserver.models.ifc2x3tc1.IfcRelDefines)

Example 2 with IfcElementQuantity

use of org.bimserver.models.ifc2x3tc1.IfcElementQuantity 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)2 IfcPropertySetDefinition (org.bimserver.models.ifc2x3tc1.IfcPropertySetDefinition)2 IfcRelDefines (org.bimserver.models.ifc2x3tc1.IfcRelDefines)2 IfcRelDefinesByProperties (org.bimserver.models.ifc2x3tc1.IfcRelDefinesByProperties)2 ArrayList (java.util.ArrayList)1 IfcPhysicalQuantity (org.bimserver.models.ifc2x3tc1.IfcPhysicalQuantity)1 IfcQuantityVolume (org.bimserver.models.ifc2x3tc1.IfcQuantityVolume)1