diff --git a/Core/IFC/IFC I.cs b/Core/IFC/IFC I.cs index 6ebdc8b..6d716f5 100644 --- a/Core/IFC/IFC I.cs +++ b/Core/IFC/IFC I.cs @@ -82,7 +82,7 @@ public partial class IfcIndexedPolyCurve : IfcBoundedCurve { private IfcCartesianPointList mPoints; // IfcCartesianPointList internal LIST mSegments = new LIST();// OPTIONAL LIST [1:?] OF IfcSegmentIndexSelect; - internal IfcLogicalEnum mSelfIntersect = IfcLogicalEnum.UNKNOWN;// Optional IfcLogical + internal IfcLogicalEnum mSelfIntersect = IfcLogicalEnum.UNKNOWN;// IfcLogical public IfcCartesianPointList Points { get { return mPoints; } set { mPoints = value; } } public LIST Segments { get { return mSegments; } } diff --git a/Core/IFC/ParserIFC.cs b/Core/IFC/ParserIFC.cs index 12966cb..d5a88d0 100644 --- a/Core/IFC/ParserIFC.cs +++ b/Core/IFC/ParserIFC.cs @@ -485,13 +485,23 @@ internal static IfcSimpleValue parseSimpleValue(string str) return new IfcText((str[9] == '$' || s == null ? "" : ParserIfc.Decode(s))); } if (str.StartsWith("IFCURIREFERENCE(")) - { return new IfcURIReference(str[16] == '$' ? "" : ParserIfc.Decode(str.Substring(17, str.Length - 19))); + if(str.StartsWith("IFCDATE(")) + { + string valueString = str.Substring(9, str.Length - 11); + if (DateTime.TryParse(valueString, out DateTime dateTime)) + return new IfcDate(dateTime); + return new IfcLabel(valueString); } - if(str.StartsWith("IFCDURATION(")) + if(str.StartsWith("IFCDATETIME(")) { - return IfcDuration.Convert(str.Substring(13, str.Length - 15)); + string valueString = str.Substring(13, str.Length - 15); + if (DateTime.TryParse(valueString, out DateTime dateTime)) + return new IfcDateTime(dateTime); + return new IfcLabel(valueString); } + if(str.StartsWith("IFCDURATION(")) + return IfcDuration.Convert(str.Substring(13, str.Length - 15)); int i = 0; if (int.TryParse(str, out i)) return new IfcInteger(i); @@ -547,14 +557,15 @@ internal static IfcSimpleValue extractSimpleValue(Type type, string value) } internal static IfcValue parseValue(string str) { - if (string.Compare(str, "$", true) == 0) + if (string.IsNullOrEmpty(str) || string.Compare(str, "$", true) == 0) return null; + IfcSimpleValue sv = parseSimpleValue(str); + if (sv != null) + return sv; IfcMeasureValue mv = parseMeasureValue(str); if (mv != null) return mv; - IfcSimpleValue sv = parseSimpleValue(str); - if (sv != null) - return sv; + return parseDerivedMeasureValue(str); } internal static IfcValue extractValue(string keyword, string value) diff --git a/Core/IFC/STEP/IFC I STEP.cs b/Core/IFC/STEP/IFC I STEP.cs index eb908a5..214900f 100644 --- a/Core/IFC/STEP/IFC I STEP.cs +++ b/Core/IFC/STEP/IFC I STEP.cs @@ -57,8 +57,7 @@ public partial class IfcIndexedPolyCurve { protected override string BuildStringSTEP(ReleaseVersion release) { - return "#" + mPoints.StepId + (mSegments.Count == 0 ? ",$," : ",(" + string.Join(",", mSegments) + "),") + - (mSelfIntersect == IfcLogicalEnum.UNKNOWN ? "$" : (mSelfIntersect == IfcLogicalEnum.TRUE ? ".T." : ".F.")); + return "#" + mPoints.StepId + (mSegments.Count == 0 ? ",$," : ",(" + string.Join(",", mSegments) + "),") + ParserIfc.LogicalToString(mSelfIntersect); } internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) { diff --git a/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs b/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs index fef557a..157d965 100644 --- a/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs +++ b/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs @@ -20,8 +20,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyVersion("0.2.04.0")] -[assembly: AssemblyFileVersion("0.2.04.0")] +[assembly: AssemblyVersion("0.2.05.0")] +[assembly: AssemblyFileVersion("0.2.05.0")] [assembly: AssemblyTitle("GeometryGymIFC")] [assembly: AssemblyDescription("C# classes to generate and parse buildingSMART IFC (Industry Foundation Class) files")] diff --git a/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs b/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs index 33eb83e..04b9b03 100644 --- a/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs +++ b/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs @@ -20,8 +20,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyVersion("0.2.04.0")] -[assembly: AssemblyFileVersion("0.2.04.0")] +[assembly: AssemblyVersion("0.2.05.0")] +[assembly: AssemblyFileVersion("0.2.05.0")] // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. diff --git a/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj b/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj index f43e2ed..e6b762d 100644 --- a/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj +++ b/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj @@ -3,7 +3,7 @@ netstandard2.0 GeometryGymIFC_Core - 0.2.03 + 0.2.05 Geometry Gym GeometryGymIFC_Core .Net Standard 2.0 C# classes to generate and parse buildingSMART IFC (Industry Foundation Class) files @@ -14,8 +14,8 @@ License https://github.com/GeometryGym/GeometryGymIFC/blob/master/LICENSE https://github.com/GeometryGym/GeometryGymIFC BIM, IFC, openBIM - 0.2.03.0 - 0.2.03.0 + 0.2.05.0 + 0.2.05.0