public static void setPropertySetPropertyUnitNameOf( String propertyName, IfcPropertySet propertySet, IfcUnit units) { for (IfcProperty property : propertySet.getHasProperties()) { if (property.getName().equalsIgnoreCase(propertyName)) { if (property instanceof IfcSimpleProperty) { if (property instanceof IfcPropertySingleValue) { ((IfcPropertySingleValue) property).setUnit(units); } if ((property instanceof IfcPhysicalSimpleQuantity) && (units instanceof IfcNamedUnit)) { ((IfcPhysicalSimpleQuantity) property).setUnit((IfcNamedUnit) units); } } } } }
private static void setSingleValueProperty(IfcValue value, IfcUnit units, IfcProperty property) { IfcPropertySingleValue singValue = (IfcPropertySingleValue) property; singValue.setNominalValue(value); singValue.setUnit(units); }