taladon

adding circulararc to feature class

Discussion created by taladon on Jan 30, 2013
Latest reply on Jan 31, 2013 by whe-esristaff
Hello,

I'm trying to import data from a legacy system. The legacy system stores all the info I need to create lines and circular arcs.
I have been able to create the circulararc object, but I can't figure out how to get it added to the feature class.
I keep getting the error: "No support for this geometry type"... I've looked at lots of other forum and documentation resources, but I just can't seem to get it to work.
[
            ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop);

            Type factoryType = Type.GetTypeFromProgID(
    "esriDataSourcesGDB.FileGDBWorkspaceFactory");
            IWorkspaceFactory wf = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
            IWorkspace workSpace = wf.OpenFromFile("f:\\test_shapes\\test-import.gdb", 0);
            IFeatureWorkspace featureSpace = (IFeatureWorkspace)workSpace;
            IFeatureClass featureClass = featureSpace.OpenFeatureClass("import45poly");
            CircularArc addme = new CircularArcClass();
            IPoint start = new Point();
            start.X = 1865640;
            start.Y = 683172;
            IPoint end = new Point();
            end.X = 1865672;
            end.Y = 683240;
            IPoint center = new Point();
            center.X = 1865686;
            center.Y = 683192;
            addme.PutCoords(center, start, end, esriArcOrientation.esriArcCounterClockwise);

            //here is where I don't know what I'm doing wrong.
            object mis1= Type.Missing;
            object mis2 = Type.Missing;

            ISegmentCollection path = new ESRI.ArcGIS.Geometry.PathClass();
            path.AddSegment((ISegment)addme, ref mis1, ref mis2);
            Polyline polyline = new Polyline();
            IGeometryCollection coll = (IGeometryCollection) polyline;
            coll.AddGeometry((IGeometry) path);

            IFeature addFeature = featureClass.CreateFeature();
            addFeature.Shape = coll.get_Geometry(0);
            addFeature.Store();
        }


Thanks in advance for your help.

--John Jackson

Outcomes