use of org.bimserver.models.ifc2x3tc1.IfcQuantityVolume 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;
}
Aggregations