AnsweredAssumed Answered

Extracting elliptical properties from TrackCircle() geometry

Question asked by Adjutant on Mar 29, 2012
Latest reply on Mar 29, 2012 by Adjutant
Hi,

Previously, in the wonderful adventures of Map Objects V2, getting the radius and centroid of a user tracked circle on the map was as easy as calling a line-liner:

  Ellipse ellipse = map.TrackCircle();   TheCakeIsReal(ellipse.Center, ellipse.radius);


In Arc Objects 10, the universal forces of ESRI and Wheatley incorporated have decided to makes things a little more interesting.

> Searched the forums for TrackCircle, but the 3 hits (http://forums.arcgis.com/search.php?searchid=997900) don't elaborate on extracting properties of the returned geometry.
> The official API (http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//001600000201000000) also has a wonderful little description : "TrackCircle returns a geometry object that implements IPolygon.".
> Having a look at older forums (http://forums.esri.com/Thread.asp?c=159&f=1706&t=159785) brings me a bit closer to the lost treasure of Atlantis, but they are calling a method called 'SetGeometry' on CircleElement, which no longer exists in the ArcObjects 10 API... and has been wiped off the ISurface of existence.
> I see that GeoEllipse is part of the Military Defence solutions extension - but I would like to be able to extract simple ellipse/circle properties without installing an extension to plan for world war 3.

Tried the following to extract elliptical properties, but all three test candidates realize that the cake is a lie when they have to face the truth that they are not compatible with the returned geometry (polyline) :
      IPolygon polygon = mapControl.TrackCircle() as IPolygon;        CircularArc circularArc = polygon as CircularArc;       CircleElement circleElement = polygon as CircleElement;       RubberCircle rubberCircle = polygon as RubberCircle;               //... circularArc.CenterPoint ?       //... circularArc.Radius ?       


Once again, could someone please point me in the right direction (for this apparently trivial operation)?
Thanks!

Outcomes