public static void setPropertySetPropertyValueOfName( String propertyName, IfcPropertySet propertySet, IfcValue value) { if (PropertyUtility.shouldSetProperty(propertyName, value)) { for (IfcProperty property : propertySet.getHasProperties()) { if (property.getName().equalsIgnoreCase(propertyName)) { if (property instanceof IfcSimpleProperty) { if (property instanceof IfcPropertySingleValue) { IfcPropertySingleValue singValue = (IfcPropertySingleValue) property; singValue.setNominalValue(value); } if (property instanceof IfcPropertyEnumeratedValue) { setEnumProperty(value, property); } if (property instanceof IfcPhysicalSimpleQuantity) { IfcPhysicalSimpleQuantity physProp = (IfcPhysicalSimpleQuantity) property; if (value instanceof IfcReal) { IfcReal ifcReal = (IfcReal) value; PropertyUtility.setIfcPhysicalSimpleQuantityValue(physProp, ifcReal); } } } } } } }
public static String getPropertySetPropertyValueOfName( String propertyName, IfcPropertySet propertySet) { String value = COBieUtility.COBieNA; for (IfcProperty property : propertySet.getHasProperties()) { if (property.getName().equals(propertyName)) { if (property instanceof IfcSimpleProperty) { IfcSimpleProperty simpleProp = (IfcSimpleProperty) property; IfcPropertyToCOBieString cobieString = new IfcPropertyToCOBieString(simpleProp); value = cobieString.getValueString(); } } } return value; }
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); } } } } }
public static void setPropertySetPropertyValueOfNameAndUnit( String propertyName, IfcPropertySet propertySet, IfcValue value, IfcUnit units) { if (PropertyUtility.shouldSetProperty(propertyName, value)) { for (IfcProperty property : propertySet.getHasProperties()) { if (property.getName().equalsIgnoreCase(propertyName)) { if (property instanceof IfcSimpleProperty) { if (property instanceof IfcPropertySingleValue) { setSingleValueProperty(value, units, property); } if (property instanceof IfcPropertyEnumeratedValue) { setEnumProperty(value, property); } if (property instanceof IfcPhysicalSimpleQuantity) { setPhysicalProperty(value, units, property); } } } } } }