Skip to content

Commit

Permalink
Merge pull request #2030 from jmcouffin/develop
Browse files Browse the repository at this point in the history
fix negativ double in filter creation + adjusted epsilon value
  • Loading branch information
jmcouffin authored Dec 20, 2023
2 parents 0ee7a38 + 4113838 commit a3892a8
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def Execute(self, uiapp):
parameter_id = DB.ElementId(sel_par._rl_par.Id.IntegerValue)
param_storage_type = sel_par._rl_par.StorageType
if param_storage_type == DB.StorageType.Double:
value = float(item._value)
value = float(sub("[^-\d|.]", "", item._value))
if version > 2021:
value_to_internal = DB.UnitUtils.ConvertToInternalUnits(
value, sel_par._rl_par.GetUnitTypeId()
Expand All @@ -362,7 +362,7 @@ def Execute(self, uiapp):
value, sel_par._rl_par.DisplayUnitType
)
equals_rule = DB.ParameterFilterRuleFactory.CreateEqualsRule(
parameter_id, value_to_internal, 0.001
parameter_id, value_to_internal, 0.5
)
elif param_storage_type == DB.StorageType.ElementId:
equals_rule = DB.ParameterFilterRuleFactory.CreateEqualsRule(
Expand All @@ -380,9 +380,7 @@ def Execute(self, uiapp):
parameter_id, item._value
)
)
except (
TypeError
): # different method in versions earlier than R2023
except TypeError: # different method in versions earlier than R2023
equals_rule = (
DB.ParameterFilterRuleFactory.CreateEqualsRule(
parameter_id, item._value, True
Expand Down

0 comments on commit a3892a8

Please sign in to comment.