conor.moloney

Create Feature and store to different FGDB

Discussion created by conor.moloney on Aug 15, 2013
Latest reply on Aug 20, 2013 by conor.moloney
I'm creating a feature and I want to store it to a specific geodatabase. At the moment I'm using feature.Store() but it's not storing it to where I want. How do I specify a location?

I want to store it to C:\College Stuff\Dissertation\2009 stuff\Geo\Geo\Full_3D.gdb

   Public Sub CreateFeature(ByVal layername1 As String, ByVal x As Double, ByVal y As Double, ByVal FeatureClass1 As IFeatureClass)



        Dim cPoint As IPoint = New ESRI.ArcGIS.Geometry.Point
        ' To individually assign a value to the coordinates, use cPoint.X = x and cPoint.Y = y.
        cPoint.PutCoords(x, y)


        ' Ensure the feature class contains points.
        If FeatureClass1.ShapeType <> esriGeometryType.esriGeometryPoint Then
            Return
        End If

        ' Build the feature.
        Dim feature As IFeature = FeatureClass1.CreateFeature()
        feature.Shape = cPoint

        ' Commit the new feature to the geodatabase.
        feature.Store()

    End Sub

Outcomes