# A3DUnitGetFromValue

A3DEUnits `A3DUnitGetFromValue`(A3DDouble dUnit)
  `A3DEUnits` A3DUnitGetFromValue(`A3DDouble` dUnit)

  Converts a units representation from `A3DDouble`to `A3DEUnits`.

  > 14.1

  HOOPS Exchange stores most of its unit information as factors of millimeters, as described in `A3DEUnits`. This function allows you to retrieve the correct unit enumeration given an input value. For example, a value of 10.returns `kA3DUnitCentimeter`.

  ## Behavior

  To properly retrieve the correct `A3DEUnits`for a given `A3DDouble`input, HOOPS Exchange compares it with the expected float value of each unit (as returned by `A3DUnitGetFromEnum()`) given a unit-specific threshold as presented by this table:

  ** Enumerator** | ** Value (millimeters)** | ** Threshold**

  - `kA3DUnitAngstrom` | 1.e-7 | 1.e-9
  - `kA3DUnitAstronomical` | 1.495978707e14 | 1.e2
  - `kA3DUnitCentimeter` | 10.0 | 0.01
  - `kA3DUnitDecimeter` | 1.e2 | 0.01
  - `kA3DUnitDekameter` | 1.e4 | 0.01
  - `kA3DUnitFoot` | 12.0 * 25.4 | 0.01
  - `kA3DUnitGigameter` | 1.e12 | 1.
  - `kA3DUnitHectometer` | 1.e5 | 0.01
  - `kA3DUnitInch` | 25.4 | 0.01
  - `kA3DUnitKilometer` | 1000000.0 | 0.01
  - `kA3DUnitLightYear` | 9.4607304725808e18 | 1.e6
  - `kA3DUnitMeter` | 1000.0 | 0.01
  - `kA3DUnitMicroInch` | 2.54e-5 | 1.e-7
  - `kA3DUnitMicron` | 1.e-3 | 1.e-4
  - `kA3DUnitMil` | 0.0254 | 1.e-4
  - `kA3DUnitMile` | 1760.0 * 3.0 * 12.0 * 25.4 | 0.01
  - `kA3DUnitMillimeter` | 1.0 | 0.01
  - `kA3DUnitNanometer` | 1.e-6 | 1.e-8
  - `kA3DUnitParsec` | 64800.0 / PI * 1.495978707e14 | 1.e7
  - `kA3DUnitPicas` | 25.4 / 6.0 | 0.01
  - `kA3DUnitPoint` | 25.4 / 72.0 | 0.01
  - `kA3DUnitUSSurveyFoot` | 1200000.0 / 3937.0 | 1.e-4
  - `kA3DUnitUSSurveyInch` | 100000.0 / 3937.0 | 1.e-5
  - `kA3DUnitUSSurveyMile` | 1760.0 * 3600000.0 / 3937.0 | 3937.,0.01
  - `kA3DUnitUSSurveyYard` | 3.0 * 1200000.0 / 3937.0 | 1.e-4
  - `kA3DUnitYard` | 3.0 * 12.0 * 25.4 | 0.01

  If the provided value does not fall under any of these value ranges, the function returns `kA3DUnitUnknown`.

  Parameters

  > dUnit: A unit value (in millimeter)

  Returns

  > An `A3DEUnits`value

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Exchange in your own language, or choose a sample question below to start a conversation:

What is HOOPS Exchange?
What are the latest release notes for HOOPS Exchange?
How do I start evaluating HOOPS Exchange?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...