DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="3.3.0-beta5214" />

 Utilities

public static class Utilities
Utility functions for unit conversion work flows and helper functions.
public static string SchemaDirectory { get; }

Path to the directory used load the schema definitions.

public static double ConvertByUnitIds(double value, string fromUnit, string toUnit)

Wrapper function that converts between a double value between one unit and another.

public static double ConvertByUnits(double value, Unit fromUnit, Unit toUnit)

Converts a value from one Unit System to another Unit System

Get all the loaded Quantities within the Dynamo session.

public static IEnumerable<Symbol> GetAllSymbols()

Get all the loaded Symbols within the Dynamo session.

public static IEnumerable<Unit> GetAllUnits()

Get all the loaded Units within the Dynamo session.

public static double ParseExpression(string expression)

Parses a string containing math functions to a unit value. For example, "(1 + 3)^2 - 4 * 2" could be converted to 8

public static double ParseExpressionByUnit(Unit targetUnit, string expression)

Parses a string containing values with units and math functions to a unit value. For example, "1ft + 2.54cm + 3in" could be converted to 14in

public static double ParseExpressionByUnitId(string targetUnit, string expression)

Parses a string to a unit value.