Skip to content

Commit 1b7b53f

Browse files
author
Jeremy Tammik
committed
flat migration to Revit 2024 complete
1 parent 8c65257 commit 1b7b53f

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

BuildingCoder/CmdMepElementShape.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ var profileTypes
8585
}
8686

8787
#region MEP Element Shape Version 1
88-
89-
/*
9088
private static class MepElementShapeV1
9189
{
92-
//private static readonly RegexCache RegexCache2 = new();
90+
private static RegexCache _regex_cache = new RegexCache();
9391

9492
private static bool Is_element_of_category(
9593
Element e,
@@ -223,25 +221,25 @@ public static string GetElementShape(Element e)
223221
return "rectangular2rectangular";
224222
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
225223
return "oval2oval";
226-
if (RegexCache2.Match(
224+
if (_regex_cache.Match(
227225
"[0-9]+\"?x[0-9]+\"?-[0-9]+\"?/[0-9]+\"?", size))
228226
return "rectangular2oval";
229-
if (RegexCache2.Match(
227+
if (_regex_cache.Match(
230228
"[0-9]+\"?/[0-9]+\"?-[0-9]+\"?x[0-9]+\"?", size))
231229
return "oval2rectangular";
232-
if (RegexCache2.Match(
230+
if (_regex_cache.Match(
233231
"[0-9]+\"?[^0-9]-[0-9]+\"?x[0-9]+\"?", size))
234232
return "round2rectangular";
235-
if (RegexCache2.Match(
233+
if (_regex_cache.Match(
236234
"[0-9]+\"?x[0-9]+\"?-[0-9]+\"?[^0-9]", size))
237235
return "rectangular2round";
238-
if (RegexCache2.Match(
236+
if (_regex_cache.Match(
239237
"[0-9]+\"?[^0-9]-[0-9]+\"?/[0-9]+\"?", size))
240238
return "round2oval";
241-
if (RegexCache2.Match(
239+
if (_regex_cache.Match(
242240
"[0-9]+\"?/[0-9]+\"?-[0-9]+\"?[^0-9]", size))
243241
return "oval2round";
244-
if (RegexCache2.Match(
242+
if (_regex_cache.Match(
245243
"[0-9]+\"?[^0-9]-[0-9]+\"?[^0-9]", size))
246244
return "round2round";
247245
return "other case";
@@ -256,7 +254,7 @@ public static string GetElementShape(Element e)
256254
/// <summary>
257255
/// Helper class to cache compiled regular expressions.
258256
/// </summary>
259-
private class RegexCache2 : Dictionary<string, Regex>
257+
private class RegexCache : Dictionary<string, Regex>
260258
{
261259
/// <summary>
262260
/// Apply regular expression pattern matching
@@ -274,8 +272,7 @@ public bool Match(string pattern, string input)
274272
}
275273
}
276274
}
277-
*/
278-
275+
279276
#endregion // MEP Element Shape Version 1
280277

281278
#region MEP Element Shape Version 2

0 commit comments

Comments
 (0)