This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > PublisherControls > ESRI.ArcGIS.PublisherControls > Interfaces > IA > IARUnitConverter Interface > IARUnitConverter.ConvertUnits Method (ArcObjects .NET 10.4 SDK) |
Converts the specified value between two units of measure.
[Visual Basic .NET] Public Function ConvertUnits ( _ ByVal dValue As Double, _ ByVal inUnits As esriARUnits, _ ByVal outUnits As esriARUnits _ ) As Double
[C#] public double ConvertUnits ( double dValue, esriARUnits inUnits, esriARUnits outUnits );
Converts the specfied value from one unit of measure to another unit of measure. For example, the method could convert the height and width of the page layout from its present page units into centimetres.
2122 800A084A: The specified enum value is invalid
IARUnitConverter unitConverter=axArcReaderControl1.ARUnitConverter; double d; //Returns 0.1005 d=unitConverter.ConvertUnits(100.5, esriARUnits.esriARUnitsMeters, esriARUnits.esriARUnitsKilometers); //Returns 10050 d=unitConverter.ConvertUnits(100.5, esriARUnits.esriARUnitsMeters, esriARUnits.esriARUnitsCentimeters);
Dim pUnitConverter As IARUnitConverter pUnitConverter=AxArcReaderControl1.ARUnitConverter Dim d As Double 'Returns 0.1005 d=pUnitConverter.ConvertUnits(100.5, esriARUnits.esriARUnitsMeters, esriARUnits.esriARUnitsKilometers) 'Returns 10050 d=pUnitConverter.ConvertUnits(100.5, esriARUnits.esriARUnitsMeters, esriARUnits.esriARUnitsCentimeters)