public static bool Add(this IfcPropertySetDefinition pSetDefinition, IfcSimpleProperty prop) { var propSet = pSetDefinition as IfcPropertySet; if(propSet!=null) propSet.HasProperties.Add(prop); return propSet != null; }
/// <summary> /// get the property value /// </summary> /// <param name="p"></param> /// <param name="ifcGlobalUnits">global unit dictionary</param> /// <returns></returns> public static string FormatPropertyValue(IfcSimpleProperty p, ConcurrentDictionary<string, string> ifcGlobalUnits) { if ((p is IfcPropertySingleValue) && (((IfcPropertySingleValue)p).NominalValue != null)) { return FormatPropertyValue((p as IfcPropertySingleValue), ifcGlobalUnits); } if (p is IfcPropertyEnumeratedValue) { return FormatPropertyValue((p as IfcPropertyEnumeratedValue), ifcGlobalUnits); } if (p is IfcPropertyBoundedValue) { return FormatePropertyValue((p as IfcPropertyBoundedValue), ifcGlobalUnits); } if (p is IfcPropertyTableValue) { return FormatePropertyValue((p as IfcPropertyTableValue), ifcGlobalUnits); } if (p is IfcPropertyReferenceValue) { return FormatPropertyValue((p as IfcPropertyReferenceValue)); } if (p is IfcPropertyListValue) { return FormatPropertyValue((p as IfcPropertyListValue), ifcGlobalUnits); } return string.Empty; }