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;
}
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;
}
Aggregations