AnsweredAssumed Answered

DataManagementTools.CreateFeatureclass vb.net

Question asked by elussier on Oct 30, 2013
Latest reply on Oct 30, 2013 by elussier
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]

Outcomes