Closed eihov closed 3 years ago
I have looked into the code of parsing IfcCrossSectionPosition and made a new parse method to parse lists like these:
public static List<string> SplitField(string s)
{
var returnValues = new List<string>();
var len = s.Length;
int pos = 0;
while (true)
{
if (!(pos < s.Length))
{
throw new Exception("Unrecognized format!");
};
if (pos == 0)
{
if (s[pos] == '(')
{
pos++;
}
else
{
throw new Exception("Unrecognized format!");
}
}
string value = "";
while (true)
{
if (!(pos < s.Length))
{
throw new Exception("Unrecognized format!");
};
if (s[pos] == ',')
{
returnValues.Add(value);
pos++;
break;
}
if (pos == s.Length - 1 && s[pos] == ')')
{
returnValues.Add(value);
return returnValues;
}
value += s[pos];
pos++;
}
}
}
So it can be used inside the parser like this:
Perhaps if I get the right permission I can make a pull request of these changes that you can review?
Thank you!
Hi,
When importing IfcSectionedSolidHorizontal the CrossSectionPositions list will only be availiable if IfcParameterValue is used as IfcCurveMeasureSelect. When I use IfcNonNegativeLengthMeasure the CrossSectionPositions list will not get loaded:
Thank you for any feedback!