Real-World Units

The file acad.unt defines a variety of conversions between real-world units such as miles/kilometers, Fahrenheit/Celsius, and so on. The function acutCvUnit() takes a value expressed in one system of units and returns the equivalent value in another system. The two systems of units are specified by strings that must match one of the definitions in acad.unt.

If the current drawing units are engineering or architectural (feet and inches), the following fragment converts a user-specified distance into meters.

ads_real eng_len, metric_len; 
char *prmpt = "Select a distance: "; 
if (acedGetDist(NULL, prmpt, &eng_len) != RTNORM) 
    return BAD; 
acutCvUnit(eng_len, "inches", "meters", &metric_len);

The acutCvUnit() function will not convert incompatible units, such as inches into years.