Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

adding circulararc to feature class

$
0
0
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.
[
Code:

            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

Viewing all articles
Browse latest Browse all 1374

Trending Articles