public virtual string WhereRule() { if (!IfcDimensionalExponents.CorrectDimensions(_unitType, Dimensions)) { return(string.Format("WR1 NamedUnit : The dimensions of the named unit {0} are not correct\n", _unitType.ToString())); } else { return(""); } }
internal static void ResolveUnits(IfcStore ifcStore, Dictionary <string, string> propertySetNamePropertyNameToUnit) { IEnumerable <IfcPropertySet> psets = ifcStore.Instances.OfType <IfcPropertySet>(); foreach (IfcPropertySet pset in psets) { if (pset != null && pset.Name != null) { IItemSet <IfcProperty> properties = pset.HasProperties; foreach (IfcProperty property in properties) { if (property is IIfcPropertySingleValue && property != null && property.Name != null) { IIfcPropertySingleValue propertySingleValue = property as IIfcPropertySingleValue; IfcUnitEnum ifcUnitEnum = resolveUnit(propertySingleValue); if (!ifcUnitEnum.Equals(IfcUnitEnum.USERDEFINED)) { var key = pset.Name + "_" + property.Name; if (!propertySetNamePropertyNameToUnit.ContainsKey(key)) { IfcSIUnit ifcSIUnit = ifcStore.FederatedInstances .Where <IfcSIUnit>(a => a.UnitType.ToString().Equals(ifcUnitEnum.ToString())) .FirstOrDefault <IfcSIUnit>(); if (ifcSIUnit != null && ifcSIUnit.Symbol != null) { var value = ifcSIUnit.UnitType.ToString() + "|" + ifcSIUnit.Symbol.ToString(); propertySetNamePropertyNameToUnit.Add(key, value); } } } } } } } }
protected override string BuildStringSTEP() { return(base.BuildStringSTEP() + "," + (mDimensions == 0 ? "*" : ParserSTEP.LinkToString(mDimensions)) + ",." + mUnitType.ToString() + "."); }