Skip to content

Commit a4d2a9f

Browse files
committed
increase accuracy
1 parent 4b60c35 commit a4d2a9f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

sources/RevitDBExplorer/Domain/DataModel/SnoopableParameter.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,18 @@ public string GenerateQueryForForParameterValue()
6060
#if R2022b
6161
if (units != null)
6262
{
63-
64-
var formatted = UnitFormatUtils.Format(units, parameter.Definition.GetDataType(), vcd.Value, false, new FormatValueOptions { AppendUnitSymbol = true });
63+
var options = new FormatValueOptions { AppendUnitSymbol = true };
64+
var dataType = parameter.Definition.GetDataType();
65+
var copy = new FormatOptions(units.GetFormatOptions(dataType));
66+
if (Units.IsModifiableSpec(dataType))
67+
{
68+
if (copy.Accuracy > 0.000001)
69+
{
70+
copy.Accuracy = 0.000001;
71+
}
72+
options.SetFormatOptions(copy);
73+
}
74+
var formatted = UnitFormatUtils.Format(units, dataType, vcd.Value, false, options);
6575
value = $"= {formatted}";
6676

6777
}

sources/RevitDBExplorer/Domain/RevitDatabaseQuery/Filters/ParameterFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private static QueryItem Create(ICommand command)
191191

192192
if (storageType == (StorageType.Double))
193193
{
194-
double epsilon = 1e-6;
194+
double epsilon = 1e-5;
195195
rule = @operator.Type switch
196196
{
197197
OperatorType.Equals => ParameterFilterRuleFactory.CreateEqualsRule(parameter, argument.Double, epsilon),

0 commit comments

Comments
 (0)