UnitExtensions
using Autodesk.DesignScript.Runtime;
using System;
namespace DynamoUnits
{
[SupressImportIntoVM]
[Obsolete("This class will be removed in a future version of Dynamo - please use the Quantity and Unit types and associated methods")]
public static class UnitExtensions
{
public static bool AlmostEquals(this double double1, double double2, double precision)
{
return Math.Abs(double1 - double2) <= precision;
}
public static Length ToLength(this double value)
{
return new Length(value);
}
public static Area ToArea(this double value)
{
return new Area(value);
}
public static Volume ToVolume(this double value)
{
return new Volume(value);
}
}
}