Skip to content

Commit

Permalink
flat migration to Revit 2024 complete
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytammik committed Jan 24, 2024
1 parent 8c65257 commit 1b7b53f
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions BuildingCoder/CmdMepElementShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ var profileTypes
}

#region MEP Element Shape Version 1

/*
private static class MepElementShapeV1
{
//private static readonly RegexCache RegexCache2 = new();
private static RegexCache _regex_cache = new RegexCache();

private static bool Is_element_of_category(
Element e,
Expand Down Expand Up @@ -223,25 +221,25 @@ public static string GetElementShape(Element e)
return "rectangular2rectangular";
if (size.Split('/').Length == 3) // but if in imperial units size is in fractional inches format it has to be replaced by another regular expression
return "oval2oval";
if (RegexCache2.Match(
if (_regex_cache.Match(
"[0-9]+\"?x[0-9]+\"?-[0-9]+\"?/[0-9]+\"?", size))
return "rectangular2oval";
if (RegexCache2.Match(
if (_regex_cache.Match(
"[0-9]+\"?/[0-9]+\"?-[0-9]+\"?x[0-9]+\"?", size))
return "oval2rectangular";
if (RegexCache2.Match(
if (_regex_cache.Match(
"[0-9]+\"?[^0-9]-[0-9]+\"?x[0-9]+\"?", size))
return "round2rectangular";
if (RegexCache2.Match(
if (_regex_cache.Match(
"[0-9]+\"?x[0-9]+\"?-[0-9]+\"?[^0-9]", size))
return "rectangular2round";
if (RegexCache2.Match(
if (_regex_cache.Match(
"[0-9]+\"?[^0-9]-[0-9]+\"?/[0-9]+\"?", size))
return "round2oval";
if (RegexCache2.Match(
if (_regex_cache.Match(
"[0-9]+\"?/[0-9]+\"?-[0-9]+\"?[^0-9]", size))
return "oval2round";
if (RegexCache2.Match(
if (_regex_cache.Match(
"[0-9]+\"?[^0-9]-[0-9]+\"?[^0-9]", size))
return "round2round";
return "other case";
Expand All @@ -256,7 +254,7 @@ public static string GetElementShape(Element e)
/// <summary>
/// Helper class to cache compiled regular expressions.
/// </summary>
private class RegexCache2 : Dictionary<string, Regex>
private class RegexCache : Dictionary<string, Regex>
{
/// <summary>
/// Apply regular expression pattern matching
Expand All @@ -274,8 +272,7 @@ public bool Match(string pattern, string input)
}
}
}
*/


#endregion // MEP Element Shape Version 1

#region MEP Element Shape Version 2
Expand Down

0 comments on commit 1b7b53f

Please sign in to comment.