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 ?

all suggestions are welcome

  • Is your input shapefile really called "new_pooint_3.shp"? – Hornbydd Jan 13 '14 at 12:44
  • yup it is new_pooint_3, it was a typo error at the time of its creation. – Mayur Sharma Jan 14 '14 at 4:12
1

its done :-)

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)

thank you everyone , now i can play with all other tools

0

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.

please tell whether my conclusion that it is a custom tool is correct or not.

will be eager to know how to interface these custom tools.

if anyone can help me with that it will be grateful

  • The scroll icon indicates a script tool. This one is from esri but users can also create the same type of script tool. – Justin Jan 5 '15 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.