I'm trying to to to use Mesh.CreateCylinderParameters method.
I would like to use imperial units in my drawing.
Here it says that one needs to change units to do so:
https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#CreateCylinder...
I assume I'd need to load esri/core/units and then adjust the property values as shown here:
https://developers.arcgis.com/javascript/latest/api-reference/esri-core-units.html
Here is where I get confused. There is no example as to how this is done properly. Here is what I did but no luck. Drawings did not change. Please advise.
units.MeasurementSystem = "imperial"
units.LengthUnit = "us-feet"
Solved! Go to Solution.
Actually, esri/core/units is not involved when using the createCylinder method. It is also not possible to specify a system of units (e.g. "imperial" or "metric") with this method. Instead, your actual units must be known beforehand, and the value must be one of the constants defined for LengthUnit. An example is below:
var cylinder = Mesh.createCylinder(point, {
width: 5,
depth: 4,
height: 3,
unit: "feet"
});
Actually, esri/core/units is not involved when using the createCylinder method. It is also not possible to specify a system of units (e.g. "imperial" or "metric") with this method. Instead, your actual units must be known beforehand, and the value must be one of the constants defined for LengthUnit. An example is below:
var cylinder = Mesh.createCylinder(point, {
width: 5,
depth: 4,
height: 3,
unit: "feet"
});