From 4f7a3cbf0a2cc36a7155b6c9d2dac21c74bf5fa2 Mon Sep 17 00:00:00 2001 From: Giacomo Date: Thu, 19 Jun 2025 16:57:42 +0200 Subject: [PATCH] Fix parsing of IfcPropertyTableValue: strip outer parentheses from value lists DefiningValues and DefinedValues were not parsed correctly when surrounded by parentheses like (IFCLABEL('X')). This fix removes the parentheses before calling SplitLineFields. --- Core/IFC/STEP/IFC P STEP.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Core/IFC/STEP/IFC P STEP.cs b/Core/IFC/STEP/IFC P STEP.cs index 3c20238..ab99535 100644 --- a/Core/IFC/STEP/IFC P STEP.cs +++ b/Core/IFC/STEP/IFC P STEP.cs @@ -960,6 +960,11 @@ internal override void parse(string str, ref int pos, ReleaseVersion release, in { base.parse(str, ref pos, release, len, dictionary); string s = ParserSTEP.StripField(str, ref pos, len); + + //check for parentheses around defining values + if (!string.IsNullOrEmpty(s) && s.StartsWith("(") && s.EndsWith(")")) // fix + s = s.Substring(1, s.Length - 2); + if (s[0] != '$') { List ss = ParserSTEP.SplitLineFields(s); @@ -971,6 +976,10 @@ internal override void parse(string str, ref int pos, ReleaseVersion release, in } } s = ParserSTEP.StripField(str, ref pos, len); + //check for parentheses around defining values + if (!string.IsNullOrEmpty(s) && s.StartsWith("(") && s.EndsWith(")")) // fix + s = s.Substring(1, s.Length - 2); + if (s[0] != '$') { List ss = ParserSTEP.SplitLineFields(s);