use of org.bimserver.models.ifc2x3tc1.IfcProperty in project BIMserver by opensourceBIM.
the class IfcUtils method listProperties.
/**
* Lists all properties of a given IfcPopertySet that are of type
* IfcPropertySingleValue, all values are converted to the appropriate Java
* type
*
* @param ifcObject
* @param propertySetName
* @return
*/
public static Map<String, Object> listProperties(IfcObject ifcObject, String propertySetName) {
Map<String, Object> result = new HashMap<>();
for (IfcRelDefines ifcRelDefines : ifcObject.getIsDefinedBy()) {
if (ifcRelDefines instanceof IfcRelDefinesByProperties) {
IfcRelDefinesByProperties ifcRelDefinesByProperties = (IfcRelDefinesByProperties) ifcRelDefines;
IfcPropertySetDefinition propertySetDefinition = ifcRelDefinesByProperties.getRelatingPropertyDefinition();
if (propertySetDefinition instanceof IfcPropertySet) {
IfcPropertySet ifcPropertySet = (IfcPropertySet) propertySetDefinition;
if (ifcPropertySet.getName() != null && ifcPropertySet.getName().equalsIgnoreCase(propertySetName)) {
for (IfcProperty ifcProperty : ifcPropertySet.getHasProperties()) {
if (ifcProperty instanceof IfcPropertySingleValue) {
IfcPropertySingleValue propertyValue = (IfcPropertySingleValue) ifcProperty;
result.put(propertyValue.getName(), nominalValueToObject(propertyValue.getNominalValue()));
}
}
}
}
}
}
return result;
}
Aggregations