Skip to content

Commit df3249e

Browse files
authored
Event suppression added to methods parsing properties of SpecTypeId and UnitTypeId (#1504)
2 parents 1e1a21d + f7f8cdc commit df3249e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Revit_Core_Engine/Query/SpecFromName.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,17 @@ private static void CollectSpecs()
9393
#else
9494
private static void CollectSpecs()
9595
{
96+
BH.Engine.Base.Compute.StartSuppressRecordingEvents(true, true, true);
97+
9698
m_SpecsWithNames = new Dictionary<string, ForgeTypeId>();
9799
foreach (PropertyInfo info in typeof(SpecTypeId).GetProperties())
98100
{
99101
ForgeTypeId unitType = info.GetValue(null) as ForgeTypeId;
100102
if (unitType != null)
101103
m_SpecsWithNames.Add(info.Name, unitType);
102104
}
105+
106+
BH.Engine.Base.Compute.StopSuppressRecordingEvents();
103107
}
104108

105109

Revit_Core_Engine/Query/UnitFromName.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,17 @@ private static void CollectUnits()
9393

9494
private static void CollectUnits()
9595
{
96+
BH.Engine.Base.Compute.StartSuppressRecordingEvents(false, true, true);
97+
9698
m_UnitsWithNames = new Dictionary<string, ForgeTypeId>();
9799
foreach (PropertyInfo info in typeof(UnitTypeId).GetProperties())
98100
{
99101
ForgeTypeId unitType = info.GetValue(null) as ForgeTypeId;
100102
if (unitType != null)
101103
m_UnitsWithNames.Add(info.Name, unitType);
102104
}
105+
106+
BH.Engine.Base.Compute.StopSuppressRecordingEvents();
103107
}
104108

105109

0 commit comments

Comments
 (0)