0

i am doing the following in order to use the predefined tool points to line in arctool box

 Dim ptoline As ESRI.ArcGIS.DataManagementTools.PointsToLine = New ESRI.ArcGIS.DataManagementTools.PointsToLine
 Dim pgeo As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor
 ptoline.Input_Features = " D:\Mayur\shapefiles\new_pooint_3.shp"
 ptoline.Output_Feature_Class = " D:\Mayur\shapefiles\new_line123.shp"
 pgeo.OverwriteOutput = True
 Dim geoProcessorResult As IGeoProcessorResult
 geoProcessorResult = pgeo.Execute(ptoline, Nothing)

i dont know the exact syntax of it. after running it shows error on

geoProcessorResult = pgeo.Execute(ptoline, Nothing)

Error HRESULT E_FAIL has been returned from a call to a COM component.

the references geoprocessor and datamanagement tools are included.

the path to the input feature is correct. the o/p file is created automatically.

Is there any prerequisite to run geoprocessor?

Do I have to do that workspace thing also ?


snapshot of my arc toolbox

now i know that this "points to line " is something different from other tools. it is a (third party tool) CUSTOM TOOL i guess and their interfacing is different,

i tried out with other tools and they all worked perfectly.

Can you tell me whether my conclusion that it is a custom tool is correct or not?

How do I interface these custom tools?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jan 13, 2014 at 12:35
0

1 Answer 1

1

I did it like this:

Dim pgeo As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor
pgeo.AddToolbox("c:\program files (x86)\arcgis\desktop10.1\ArcToolbox\Toolboxes\Data Management Tools.tbx")
Dim parameters As IVariantArray = New VarArray 
parameters.Add("D:\Mayur\shapefiles\new_pooint_3.shp")
parameters.Add("D:\Mayur\shapefiles\new_line123.shp")
pgeo.Execute("PointsToLine", parameters, Nothing)
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Jan 14, 2014 at 5:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.