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]
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.
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.
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.