Skip to main content

Discovery extensibility and add-ins developer guide 2026 R1

Inputting values

Last update: 09.03.2026

To parse a length string entered by the user, you can use Window.Units.Length.TryParse. As well as converting to system units, this method also handles expressions, and values with explicit units stated:

  • "(1 + 2) * 3 ^ (3/3 + 3)" = 243
  • "1cm + 1 1/2 mm" = 0.0115

Window.Units.Angle.TryParse provides the same functionality for angles.

Connect with Ansys