Select to view content in your preferred language

DataManagementTools.CreateFeatureclass vb.net

623
2
Jump to solution
10-30-2013 11:33 AM
EricLussier
Occasional Contributor
Hi,

Does some one ever use DataManagementTools.CreateFeatureclass in vb.net

I try to use this to create a sde feature class based on an other one.

could someone help me solving this please.

This the the what comes out of the catch exception:

Executing: CreateFeatureclass C:\test\test_admin_stg1.sde # POLYGON C:\test\test_admin_stg1.sde\test_admin.AAAA_ERIC_A DISABLED DISABLED {B286C06B-0879-11D2-AACA-00C04FA33C20};IsHighPrecision FRAMEWO
RK 0 0 0

Failed to execute. Parameters are not valid.

I think the error might comes for the line ataManagementCreateFeatureClass.out_path = outPathWorkSpace ... 


[HTML] Dim gp As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor()
Dim DataManagementCreateFeatureClass As ESRI.ArcGIS.DataManagementTools.CreateFeatureclass = New ESRI.ArcGIS.DataManagementTools.CreateFeatureclass()       

Dim source_fullname As String = "C:\test\test_admin_stg1.sde\test_admin.AAAA_ERIC_A"
        Dim dest_fullname As String = "C:\test\test_admin_stg1.sde\test_admin.AAAA_ERIC_A_B"

        Try
            Dim sConn As String = source_fullname.Substring(0, source_fullname.LastIndexOf("\"))
            Dim pWorkspaceFactoryIn As New ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactory
            Dim outPathWorkSpace As IWorkspace = pWorkspaceFactoryIn.OpenFromFile(sConn, 0)

            'Set the destination database 
            DataManagementCreateFeatureClass.out_path = outPathWorkSpace
            'Set destination sde table name

            DataManagementCreateFeatureClass.out_feature_class = "AAAA_ERIC_A_B"
           
    'Set source as a the template - OK car le type de geometrie est dans la string
            DataManagementCreateFeatureClass.template = source_fullname
            '
            gp.Execute(DataManagementCreateFeatureClass, Nothing)

            Console.WriteLine(gp.GetMessage(0))
            Console.WriteLine("")
            Console.WriteLine(gp.GetMessage(1))
            Console.WriteLine("")
            Console.WriteLine(gp.GetMessage(2))
        Catch ex As Exception
            Console.WriteLine("")
            Console.WriteLine(gp.GetMessage(0))
            Console.WriteLine("")
            Console.WriteLine(gp.GetMessage(1))
            Console.WriteLine("")
            Console.WriteLine(gp.GetMessage(2))
        End Try
[/HTML]
0 Kudos
1 Solution

Accepted Solutions
EricLussier
Occasional Contributor
Hi Neil,

Thanks for the comments. I have reviewed my code and I have found that
the out_name parameter was not set and also that the out_path was requiring
a workspace (object) as a value.

Thanks once more and have a nice day.

Eric

View solution in original post

0 Kudos
2 Replies
NeilClemmons
Honored Contributor
Have you tried using the actual tool in ArcToolbox to do this and looked at the parameters it displays when it runs?  If not, that's probably the best place to start.
0 Kudos
EricLussier
Occasional Contributor
Hi Neil,

Thanks for the comments. I have reviewed my code and I have found that
the out_name parameter was not set and also that the out_path was requiring
a workspace (object) as a value.

Thanks once more and have a nice day.

Eric
0 Kudos