コード例 #1
0
  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);
              }
            }
          }
        }
      }
    }
  }
コード例 #2
0
 private static void setPhysicalProperty(IfcValue value, IfcUnit units, IfcProperty property) {
   IfcPhysicalSimpleQuantity physProp = (IfcPhysicalSimpleQuantity) property;
   if (units instanceof IfcNamedUnit) {
     physProp.setUnit((IfcNamedUnit) units);
   }
   if (value instanceof IfcReal) {
     IfcReal ifcReal = (IfcReal) value;
     PropertyUtility.setIfcPhysicalSimpleQuantityValue(physProp, ifcReal);
   }
 }