<?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: Problem Creating Features in ArcObjects in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-creating-features-in-arcobjects/m-p/433049#M11733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks like you're using the same feature buffer object over and over inside your loop.&amp;nbsp; You need to create a new feature buffer each time (within the loop).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Aug 2010 20:00:43 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2010-08-19T20:00:43Z</dc:date>
    <item>
      <title>Problem Creating Features in ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-creating-features-in-arcobjects/m-p/433048#M11732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got some code (attached) that intersects a selected parcel with a soils layer, then creates a feature class in a file geodatabase with the requisite data, then adds said feature class to ArcMap for further manual editing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The feature class gets created OK and gets all the requisite attributes, but is absolutely uneditable. To boot, I notice that the 'shape_area' and 'shape_length' fields are null and am guessing that's a symptom of the underlying problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've attached the code in its entirety, but here's where I think the problem is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;__________________________________________________ ___________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pWS As IWorkspace = OpenFGDBWorkspace()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pFWs As IFeatureWorkspace = pWS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pNewFC As IFeatureClass = pFWs.OpenFeatureClass("P" &amp;amp; pinNoDash)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim newFCSTIndx As Integer = pNewFC.Fields.FindField("SoilType")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim newFCAcresIndx As Integer = pNewFC.Fields.FindField("Acreage")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pWSEdit As IWorkspaceEdit = pFWs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pArea As IArea&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pFBuf As IFeatureBuffer = pNewFC.CreateFeatureBuffer()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pInsCur As IFeatureCursor = pNewFC.Insert(True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pG As IGeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do Until parFeat Is Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pGeom = parFeat.ShapeCopy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pSoilsCur = PerformSpatialQuery(pSoilsFC, pGeom, esriSpatialRelEnum.esriSpatialRelIntersects, Nothing)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;soilsFeat = pSoilsCur.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;soiltypeIndx = soilsFeat.Fields.FindField("DSL_NAME")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do Until soilsFeat Is Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pTopoOp = soilsFeat.ShapeCopy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;outPoly = pTopoOp.Intersect(pGeom, esriGeometryDimension.esriGeometry2Dimension)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pG = outPoly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pGeometryColl = outPoly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pArea = outPoly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pFBuf.Shape = pG 'outPoly&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pFBuf.Value(newFCSTIndx) = soilsFeat.Value(soiltypeIndx)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pFBuf.Value(newFCAcresIndx) = pArea.Area / 43560&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pWSEdit.StartEditing(False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pWSEdit.StartEditOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pInsCur.InsertFeature(pFBuf)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pWSEdit.StopEditOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pWSEdit.StopEditing(True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'If pGeometryColl.GeometryCount.ToString Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'MsgBox(pNewFeat.OID)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'FlashGeometry(outPoly, aColor, screenDisplay, 1000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;soilsFeat = pSoilsCur.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;parFeat = pFCur.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Catch ex As Exception&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MsgBox(ex.Message)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marshal.ReleaseComObject(pInsCur)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marshal.ReleaseComObject(pFCur)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;__________________________________________________ ___________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 19:41:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-creating-features-in-arcobjects/m-p/433048#M11732</guid>
      <dc:creator>KentRothrock</dc:creator>
      <dc:date>2010-08-19T19:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Creating Features in ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-creating-features-in-arcobjects/m-p/433049#M11733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks like you're using the same feature buffer object over and over inside your loop.&amp;nbsp; You need to create a new feature buffer each time (within the loop).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 20:00:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-creating-features-in-arcobjects/m-p/433049#M11733</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2010-08-19T20:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Creating Features in ArcObjects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-creating-features-in-arcobjects/m-p/433050#M11734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; How you sending spatial Objects into featurclass ?, I means Geometry(Point,Line or Polygon...You are just creating Non spatial rows right ? here your missing something...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Venkat&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 09:26:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-creating-features-in-arcobjects/m-p/433050#M11734</guid>
      <dc:creator>Venkata_RaoTammineni</dc:creator>
      <dc:date>2010-08-20T09:26:01Z</dc:date>
    </item>
  </channel>
</rss>

