<?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: Exporting to a feature dataset within a file geodatabase in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140371#M3644</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply Neil. I've attached my updated code (at least the updated portion of it). I keep getting a "method or data member not found" error on the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pFeatureClassName.FeatureDatasetName = pFc.FeatureDataset.Name&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears it doesn't like pFeatureClassName.FeatureDatasetName&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but it returns no errors on&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pFeatureClassName.FeatureType = pFc.FeatureType
pFeatureClassName.ShapeType = pFc.ShapeType
pFeatureClassName.ShapeFieldName = pFc.ShapeFieldName&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:44:22 GMT</pubDate>
    <dc:creator>ShaunConway</dc:creator>
    <dc:date>2021-12-11T07:44:22Z</dc:date>
    <item>
      <title>Exporting to a feature dataset within a file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140369#M3642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the attached code which accepts a feature class as a parameter and saves a copy of this feature class as a new feature class in a file geodatabase. My problem is that I would like to save the exported feature class to a specific feature dataset within the target file geodatabase.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please share how this is accomplished?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Dim pInFeatureClassName As IFeatureClassName
Dim pDataSet As IDataset
Dim pInDsName As IDatasetName
Dim pFSel As IFeatureSelection
Dim pSelSet As ISelectionSet
Dim pFeatureClassName As IFeatureClassName
Dim pOutDatasetName As IDatasetName
Dim pWorkspaceName As IWorkspaceName
Dim pExportOp As IExportOperation
Dim pFeatureLayer As IFeatureLayer


'Get the Featureclassname from the featureclass
Set pDataSet = pFC
Set pInFeatureClassName = pDataSet.FullName

'Define the output featureclass
'give it the name of the input feature class + exp
Set pFeatureClassName = New FeatureClassName
Set pOutDatasetName = pFeatureClassName
pOutDatasetName.Name = "scenario_" &amp;amp; frmSaveScenario.tbScenarioName &amp;amp; "_" &amp;amp; sType
 
Set pWorkspaceName = New WorkspaceName
pWorkspaceName.WorkspaceFactoryProgID = "esriDataSourcesGDB.FileGDBWorkspaceFactory"
pWorkspaceName.PathName = "\\tempest\shared\GIS\Community Development\Redistricting\Census\2000_Census.gdb"


Set pOutDatasetName.WorkspaceName = pWorkspaceName

'Give the output shapefile the same props as the input dataset
pFeatureClassName.FeatureType = pFC.FeatureType
pFeatureClassName.ShapeType = pFC.ShapeType
pFeatureClassName.ShapeFieldName = pFC.ShapeFieldName
'pFeatureClassName.FeatureDatasetName = pFC.FeatureDataset

Set pInDsName = pInFeatureClassName

'Export selected features
Set pExportOp = New ExportOperation
pExportOp.ExportFeatureClass pInDsName, Nothing, Nothing, Nothing, pOutDatasetName, 0&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 16:40:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140369#M3642</guid>
      <dc:creator>ShaunConway</dc:creator>
      <dc:date>2011-02-17T16:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to a feature dataset within a file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140370#M3643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;'pFeatureClassName.FeatureDatasetName = pFC.FeatureDataset&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know that I've ever tried it but this line looks like a type mismatch.&amp;nbsp; A dataset name object is required, not a dataset.&amp;nbsp; You can get the dataset name object from the workspace's DatasetNames.&amp;nbsp; You might also be able to use the name object from the dataset.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 17:59:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140370#M3643</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-02-17T17:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to a feature dataset within a file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140371#M3644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply Neil. I've attached my updated code (at least the updated portion of it). I keep getting a "method or data member not found" error on the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pFeatureClassName.FeatureDatasetName = pFc.FeatureDataset.Name&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears it doesn't like pFeatureClassName.FeatureDatasetName&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but it returns no errors on&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pFeatureClassName.FeatureType = pFc.FeatureType
pFeatureClassName.ShapeType = pFc.ShapeType
pFeatureClassName.ShapeFieldName = pFc.ShapeFieldName&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:44:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140371#M3644</guid>
      <dc:creator>ShaunConway</dc:creator>
      <dc:date>2021-12-11T07:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to a feature dataset within a file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140372#M3645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like you're using VBA or VB6.&amp;nbsp; If so, you usually need to use Set when assigning object values.&amp;nbsp; Also, you'll want to be sure that the feature class you're referencing is inside a feature dataset or its FeatureDataset property will be Nothing.&amp;nbsp; Your current code will error out if that's the case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: Another possible thing to consider. You may need to use a dataset name object that comes from the workspace you're exporting into.&amp;nbsp; It may also be required that this feature dataset already exist in that workspace.&amp;nbsp; The exporter probably will not create it for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 18:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140372#M3645</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-02-17T18:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting to a feature dataset within a file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140373#M3646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the help everyone. Here is revamped code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
pFeatureClassName.FeatureType = pFc.FeatureType
pFeatureClassName.ShapeType = pFc.ShapeType
pFeatureClassName.ShapeFieldName = pFc.ShapeFieldName
Set pFeatureClassName.FeatureDatasetName = pFc.FeatureDataset.FullName&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code still bombed out if I used &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Set pFeatureClassName.FeatureDatasetName = pFc.FeatureDataset.Name[&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Set pFeatureClassName.FeatureDatasetName = pFc.FeatureDataset.FullName[&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its working now. Thanks again for the quick replies - I really appreciate the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/exporting-to-a-feature-dataset-within-a-file/m-p/140373#M3646</guid>
      <dc:creator>ShaunConway</dc:creator>
      <dc:date>2021-12-11T07:44:25Z</dc:date>
    </item>
  </channel>
</rss>

