public static AreaUnit CreateAreaUnit( int factoryCode )
Public Overloads Shared Function CreateAreaUnit( _ ByVal factoryCode As Integer _ ) As AreaUnit
Parameters
- factoryCode
- The area unit factory code
Return Value
An AreaUnit.
public static AreaUnit CreateAreaUnit( int factoryCode )
Public Overloads Shared Function CreateAreaUnit( _ ByVal factoryCode As Integer _ ) As AreaUnit
Exception | Description |
---|---|
System.ArgumentException | The factoryCode is not a valid area unit code |
try { var myFactoryCodeInit = AreaUnit.CreateAreaUnit(109439); // 109439 is the factory code for square miles var myWktUnit = AreaUnit.CreateAreaUnit("HECTARE_AREAUNIT[\"H\",10000.0]"); var myCustomUnit = AreaUnit.CreateAreaUnit("myAreaUnit", 12); } catch (ArgumentException) { // ArgumentException will be thrown by CreateAreaUnit in the following scenarios // - if the factory code used is a non-areal factory code (i.e. it corresponds to degrees which is an angular unit code) // - if the factory code used is invalid (i.e. it is negative or doesn't correspond to any factory code) }
Target Platforms: Windows 10, Windows 8.1, Windows 7