<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Save a Geometry (draw using Rubberband) as a feature in Feature Class in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161283#M4222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;Replace the following line&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;&lt;BR /&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryAny;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;esriGeometryPolygon&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;;&lt;BR /&gt;&lt;BR /&gt;Also have a look at the following link&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Apr 2013 14:41:10 GMT</pubDate>
    <dc:creator>ThavitinaiduGulivindala</dc:creator>
    <dc:date>2013-04-22T14:41:10Z</dc:date>
    <item>
      <title>Save a Geometry (draw using Rubberband) as a feature in Feature Class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161279#M4218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Namaste, Hola, Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the Code below I have created a Line geometry using Rubberbanding&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public void DrawPolyline(ESRI.ArcGIS.Carto.IActiveView activeView)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if(activeView == null)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache); // Explicit Cast&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IRgbColor rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; rgbColor.Red = 255;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IColor color = rgbColor; // Implicit Cast&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.ISimpleLineSymbol simpleLineSymbol = new ESRI.ArcGIS.Display.SimpleLineSymbolClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; simpleLineSymbol.Color = color;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.ISymbol symbol = (ESRI.ArcGIS.Display.ISymbol)simpleLineSymbol; // Explicit Cast&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberLineClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Geometry.IGeometry geometry = rubberBand.TrackNew(screenDisplay, symbol);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.SetSymbol(symbol);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.DrawPolyline(&lt;/SPAN&gt;&lt;STRONG&gt;geometry&lt;/STRONG&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.FinishDrawing();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After Drawing a Line geometry using Rubberband, I would like to save the "geometry" as a feature in a FeatureClass and create a Feature Layer and display the layer. I am facing trouble in creating feature class and saving a feature. Please help me with some sample Code .. I am badly waiting for some reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pavan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Apr 2013 14:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161279#M4218</guid>
      <dc:creator>Santosh_Pavan_KumarNukala</dc:creator>
      <dc:date>2013-04-20T14:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Save a Geometry (draw using Rubberband) as a feature in Feature Class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161280#M4219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Below are the samples to create feature class and feature&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0049000000pz000000"&gt;&lt;BR /&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0049000000pz000000&lt;BR /&gt;&lt;/A&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000049v000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000049v000000&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Apr 2013 13:53:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161280#M4219</guid>
      <dc:creator>ThavitinaiduGulivindala</dc:creator>
      <dc:date>2013-04-21T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Save a Geometry (draw using Rubberband) as a feature in Feature Class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161281#M4220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Below are the samples to create feature class and feature&amp;nbsp; &lt;BR /&gt; &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0049000000pz000000" rel="nofollow"&gt;&lt;BR /&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0049000000pz000000&lt;BR /&gt;&lt;/A&gt; &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000049v000000" rel="nofollow"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000049v000000&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have seen the above mentioned links earlier also and tried to create a new feature class and add a feature into it but was facing issues, Hence I asked for some sample working code if anyone already had. Currently I am getting "No Current Record." Exception when I call CreateFeatureClass method on IFeatureWorkSpace and am unable to resolve the issue. This issue has previously been addressed in the forum which is left Unanswered .. &lt;/SPAN&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=159&amp;amp;f=1707&amp;amp;t=225079" rel="nofollow"&gt;http://forums.esri.com/Thread.asp?c=159&amp;amp;f=1707&amp;amp;t=225079&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyways I am pasting my code, Kindly help on this. I am Stuck up and badly in need of help &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; public void DrawPolygon(ESRI.ArcGIS.Carto.IActiveView activeView)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; if (activeView == null)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; // Constant&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache); // Explicit Cast&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IRgbColor rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; rgbColor.Red = 255;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IColor color = rgbColor; // Implicit Cast&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.ISimpleFillSymbol simpleFillSymbol = new ESRI.ArcGIS.Display.SimpleFillSymbolClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; simpleFillSymbol.Color = color;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.ISymbol symbol = simpleFillSymbol as ESRI.ArcGIS.Display.ISymbol; // Dynamic Cast&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberPolygonClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ESRI.ArcGIS.Geometry.IGeometry geometry = rubberBand.TrackNew(screenDisplay, symbol);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.SetSymbol(symbol);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.DrawPolygon(geometry);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; screenDisplay.FinishDrawing();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IWorkspace pWorkSpace = CreateAccessWorkspace(@"J:\GIS\DGN\");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)pWorkSpace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; // createFeatureDataset();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)featureWorkspace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; workspaceEdit.StartEditing(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; workspaceEdit.StartEditOperation();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IFields fields = new FieldsClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFieldsEdit fieldsEdit = (IFieldsEdit)fields;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IField oidField = new FieldClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFieldEdit oidFieldEdit = (IFieldEdit)oidField;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oidFieldEdit.Name_2 = "OID";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; oidFieldEdit.Type_2 = esriFieldType.esriFieldTypeOID;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fieldsEdit.AddField(oidField);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IGeometryDef geometryDef = new GeometryDefClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IGeometryDefEdit geometryDefEdit = (IGeometryDefEdit)geometryDef;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryAny;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ISpatialReference spatialReference = spatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_WGS1984UTM_17N);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ISpatialReferenceResolution spatialReferenceResolution = (ISpatialReferenceResolution)spatialReference;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; spatialReferenceResolution.ConstructFromHorizon();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; spatialReferenceResolution.SetDefaultXYResolution();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ISpatialReferenceTolerance spatialReferenceTolerance = (ISpatialReferenceTolerance)spatialReference;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; spatialReferenceTolerance.SetDefaultXYTolerance();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; geometryDefEdit.SpatialReference_2 = spatialReference;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IField geometryField = new FieldClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFieldEdit geometryFieldEdit = (IFieldEdit)geometryField;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; geometryFieldEdit.Name_2 = "Shape";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; geometryFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; geometryFieldEdit.GeometryDef_2 = geometryDef;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fieldsEdit.AddField(geometryField);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IField nameField = new FieldClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFieldEdit nameFieldEdit = (IFieldEdit)nameField;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; nameFieldEdit.Name_2 = "Name";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; nameFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; nameFieldEdit.Length_2 = 20;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fieldsEdit.AddField(nameField);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IFieldChecker fieldChecker = new FieldCheckerClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IEnumFieldError enumFieldError = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFields validatedFields = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fieldChecker.ValidateWorkspace = (IWorkspace)featureWorkspace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fieldChecker.Validate(fields, out enumFieldError, out validatedFields);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;STRONG&gt;// &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;"NO CURRENT RECORD" EXCEPTION HERE&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureClass featureClass = featureWorkspace.CreateFeatureClass("FC007", validatedFields, null, null, esriFeatureType.esriFTSimple, "Shape", "");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IFeatureClass pFeatureClass = featureClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; featureWorkspace.OpenFeatureClass(pFeatureClass.AliasName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFeature feature = pFeatureClass.CreateFeature();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; feature.Shape = geometry;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; int contractorFieldIndex = pFeatureClass.FindField("Name");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; feature.set_Value(contractorFieldIndex, "Krishna");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; feature.Store();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; workspaceEdit.StopEditOperation();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; workspaceEdit.StopEditing(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; IFeatureLayer pFeatureLayer = new FeatureLayerClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pFeatureLayer.FeatureClass = pFeatureClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pFeatureLayer.Name = pFeatureClass.AliasName;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; axMapControl1.AddLayer(pFeatureLayer as ILayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pavan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 10:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161281#M4220</guid>
      <dc:creator>Santosh_Pavan_KumarNukala</dc:creator>
      <dc:date>2013-04-22T10:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Save a Geometry (draw using Rubberband) as a feature in Feature Class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161282#M4221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Thanks for the reply,&amp;nbsp; &lt;BR /&gt;I have seen the above mentioned links earlier also and tried to create a new feature class and add a feature into it but was facing issues, Hence I asked for some sample working code if anyone already had. Currently I am getting "No Current Record." Exception when I call CreateFeatureClass method on IFeatureWorkSpace and am unable to resolve the issue. This issue has previously been addressed in the forum which is left Unanswered ..&amp;nbsp;&amp;nbsp; &lt;A href="http://forums.esri.com/Thread.asp?c=159&amp;amp;f=1707&amp;amp;t=225079" rel="nofollow"&gt;http://forums.esri.com/Thread.asp?c=159&amp;amp;f=1707&amp;amp;t=225079&lt;/A&gt; &lt;BR /&gt;Anyways I am pasting my code, Kindly help on this. I am Stuck up and badly in need of help &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; public void DrawPolygon(ESRI.ArcGIS.Carto.IActiveView activeView)&amp;nbsp; &lt;BR /&gt; {&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; if (activeView == null)&amp;nbsp; &lt;BR /&gt; {&amp;nbsp; &lt;BR /&gt; return;&amp;nbsp; &lt;BR /&gt; }&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = activeView.ScreenDisplay;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; // Constant&amp;nbsp; &lt;BR /&gt; screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache); // Explicit Cast&amp;nbsp; &lt;BR /&gt; ESRI.ArcGIS.Display.IRgbColor rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();&amp;nbsp; &lt;BR /&gt; rgbColor.Red = 255;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; ESRI.ArcGIS.Display.IColor color = rgbColor; // Implicit Cast&amp;nbsp; &lt;BR /&gt; ESRI.ArcGIS.Display.ISimpleFillSymbol simpleFillSymbol = new ESRI.ArcGIS.Display.SimpleFillSymbolClass();&amp;nbsp; &lt;BR /&gt; simpleFillSymbol.Color = color;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; ESRI.ArcGIS.Display.ISymbol symbol = simpleFillSymbol as ESRI.ArcGIS.Display.ISymbol; // Dynamic Cast&amp;nbsp; &lt;BR /&gt; ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberPolygonClass();&amp;nbsp; &lt;BR /&gt; ESRI.ArcGIS.Geometry.IGeometry geometry = rubberBand.TrackNew(screenDisplay, symbol);&amp;nbsp; &lt;BR /&gt; screenDisplay.SetSymbol(symbol);&amp;nbsp; &lt;BR /&gt; screenDisplay.DrawPolygon(geometry);&amp;nbsp; &lt;BR /&gt; screenDisplay.FinishDrawing();&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; IWorkspace pWorkSpace = CreateAccessWorkspace(@"J:\GIS\DGN\");&amp;nbsp; &lt;BR /&gt; IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)pWorkSpace;&amp;nbsp; &lt;BR /&gt; // createFeatureDataset();&amp;nbsp; &lt;BR /&gt; IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)featureWorkspace;&amp;nbsp; &lt;BR /&gt; workspaceEdit.StartEditing(false);&amp;nbsp; &lt;BR /&gt; workspaceEdit.StartEditOperation();&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; IFields fields = new FieldsClass();&amp;nbsp; &lt;BR /&gt; IFieldsEdit fieldsEdit = (IFieldsEdit)fields;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; IField oidField = new FieldClass();&amp;nbsp; &lt;BR /&gt; IFieldEdit oidFieldEdit = (IFieldEdit)oidField;&amp;nbsp; &lt;BR /&gt; oidFieldEdit.Name_2 = "OID";&amp;nbsp; &lt;BR /&gt; oidFieldEdit.Type_2 = esriFieldType.esriFieldTypeOID;&amp;nbsp; &lt;BR /&gt; fieldsEdit.AddField(oidField);&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; IGeometryDef geometryDef = new GeometryDefClass();&amp;nbsp; &lt;BR /&gt; IGeometryDefEdit geometryDefEdit = (IGeometryDefEdit)geometryDef;&amp;nbsp; &lt;BR /&gt; geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryAny;&amp;nbsp; &lt;BR /&gt; ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();&amp;nbsp; &lt;BR /&gt; ISpatialReference spatialReference = spatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_WGS1984UTM_17N);&amp;nbsp; &lt;BR /&gt; ISpatialReferenceResolution spatialReferenceResolution = (ISpatialReferenceResolution)spatialReference;&amp;nbsp; &lt;BR /&gt; spatialReferenceResolution.ConstructFromHorizon();&amp;nbsp; &lt;BR /&gt; spatialReferenceResolution.SetDefaultXYResolution();&amp;nbsp; &lt;BR /&gt; ISpatialReferenceTolerance spatialReferenceTolerance = (ISpatialReferenceTolerance)spatialReference;&amp;nbsp; &lt;BR /&gt; spatialReferenceTolerance.SetDefaultXYTolerance();&amp;nbsp; &lt;BR /&gt; geometryDefEdit.SpatialReference_2 = spatialReference;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; IField geometryField = new FieldClass();&amp;nbsp; &lt;BR /&gt; IFieldEdit geometryFieldEdit = (IFieldEdit)geometryField;&amp;nbsp; &lt;BR /&gt; geometryFieldEdit.Name_2 = "Shape";&amp;nbsp; &lt;BR /&gt; geometryFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;&amp;nbsp; &lt;BR /&gt; geometryFieldEdit.GeometryDef_2 = geometryDef;&amp;nbsp; &lt;BR /&gt; fieldsEdit.AddField(geometryField);&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; IField nameField = new FieldClass();&amp;nbsp; &lt;BR /&gt; IFieldEdit nameFieldEdit = (IFieldEdit)nameField;&amp;nbsp; &lt;BR /&gt; nameFieldEdit.Name_2 = "Name";&amp;nbsp; &lt;BR /&gt; nameFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;&amp;nbsp; &lt;BR /&gt; nameFieldEdit.Length_2 = 20;&amp;nbsp; &lt;BR /&gt; fieldsEdit.AddField(nameField);&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; IFieldChecker fieldChecker = new FieldCheckerClass();&amp;nbsp; &lt;BR /&gt; IEnumFieldError enumFieldError = null;&amp;nbsp; &lt;BR /&gt; IFields validatedFields = null;&amp;nbsp; &lt;BR /&gt; fieldChecker.ValidateWorkspace = (IWorkspace)featureWorkspace;&amp;nbsp; &lt;BR /&gt; fieldChecker.Validate(fields, out enumFieldError, out validatedFields);&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;// &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;"NO CURRENT RECORD" EXCEPTION HERE&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;IFeatureClass featureClass = featureWorkspace.CreateFeatureClass("FC007", validatedFields, null, null, esriFeatureType.esriFTSimple, "Shape", "");&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; IFeatureClass pFeatureClass = featureClass;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; featureWorkspace.OpenFeatureClass(pFeatureClass.AliasName);&amp;nbsp; &lt;BR /&gt; IFeature feature = pFeatureClass.CreateFeature();&amp;nbsp; &lt;BR /&gt; feature.Shape = geometry;&amp;nbsp; &lt;BR /&gt; int contractorFieldIndex = pFeatureClass.FindField("Name");&amp;nbsp; &lt;BR /&gt; feature.set_Value(contractorFieldIndex, "Krishna");&amp;nbsp; &lt;BR /&gt; feature.Store();&amp;nbsp; &lt;BR /&gt; workspaceEdit.StopEditOperation();&amp;nbsp; &lt;BR /&gt; workspaceEdit.StopEditing(true);&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; IFeatureLayer pFeatureLayer = new FeatureLayerClass();&amp;nbsp; &lt;BR /&gt; pFeatureLayer.FeatureClass = pFeatureClass;&amp;nbsp; &lt;BR /&gt; pFeatureLayer.Name = pFeatureClass.AliasName;&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; axMapControl1.AddLayer(pFeatureLayer as ILayer);&amp;nbsp; &lt;BR /&gt; }&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;Thanks and Regards,&amp;nbsp; &lt;BR /&gt;Pavan&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Pavan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please check if start editing is creating issue. you dont need to start edit at the start, as you are doing it workspace is not able to create featureclass. if u check we cannot create fields or featureclass while editing is on in arcmap as there is lock. start editing, once featureclass has been created and you are just about to create feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About error many a times arcobjects gives misleading error message. try setting 'next statement' on the statement which is giving error (i.e. check error twice on the same line it will give different error) and F10 again. 1st time it will give error which you told and 2nd time it may say. "workspace is in use"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;other work around is, save a empty featureclass with schema in installation path/bin and copy paste it on other location on the fly programatically and create feature which is rightly done in the code and add it on arcmap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Link which you shared is of engine. sometimes arcobjects give error which gives lead where we get seriously stuck up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;disclaimer: looking at the problem this is all i can guess!!! Happy hunting!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sameer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 11:48:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161282#M4221</guid>
      <dc:creator>sameerpuppal</dc:creator>
      <dc:date>2013-04-22T11:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Save a Geometry (draw using Rubberband) as a feature in Feature Class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161283#M4222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;Replace the following line&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;&lt;BR /&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryAny;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;esriGeometryPolygon&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;;&lt;BR /&gt;&lt;BR /&gt;Also have a look at the following link&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 14:41:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161283#M4222</guid>
      <dc:creator>ThavitinaiduGulivindala</dc:creator>
      <dc:date>2013-04-22T14:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Save a Geometry (draw using Rubberband) as a feature in Feature Class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161284#M4223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;Replace the following line&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;&lt;BR /&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryAny;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;esriGeometryPolygon&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;;&lt;BR /&gt;&lt;BR /&gt;Also have a look at the following link&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ohh! i missed it!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 05:18:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161284#M4223</guid>
      <dc:creator>sameerpuppal</dc:creator>
      <dc:date>2013-04-23T05:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Save a Geometry (draw using Rubberband) as a feature in Feature Class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161285#M4224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;Replace the following line&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;&lt;BR /&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryAny;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;geometryDefEdit.GeometryType_2 = esriGeometryType.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;esriGeometryPolygon&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-style: italic;"&gt;;&lt;BR /&gt;&lt;BR /&gt;Also have a look at the following link&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/GeometryType_Property/0025000003qs000000/&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to all for the reply.. Yes the error is now gone, but I have a basic doubt. If I specify esriGeometryType to esriGeometryPolygon.. does that mean I cannot store Point and polyline feature in the same feature class. Do i need to create a separate feature classes for each geometry type. In order to create a FeatureLayer from a Feature Class, can I assign multiple featureclasses to same feature layer or is it one to one corresponce. Also let me know how can i change the symbology of a Feature and delete a feature interactively (i.e selecting a feature and deleting).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;These might be basic questions but please do reply patiently.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pavan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 06:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/save-a-geometry-draw-using-rubberband-as-a-feature/m-p/161285#M4224</guid>
      <dc:creator>Santosh_Pavan_KumarNukala</dc:creator>
      <dc:date>2013-04-23T06:03:08Z</dc:date>
    </item>
  </channel>
</rss>

