Select to view content in your preferred language

using points to line tool in modelbuilder

2954
2
04-14-2011 12:10 AM
WhereMatters
Frequent Contributor
Hi,

I have a text file containing coordinates in sequences (shapes.txt) that can be used to construct a line layer. I can do it successfully if i first convert shapes.txt into a point feature class and the use the points to line tool to get a line feature class.

However, if i try to do the same in modelbuilder by using the same processes and i get an update parameters error. This is because I am using "make xy event layer" tool to get a temporary point layer and then feeding it to points-to-line tool. The problem i guess here is i need to select the sort field and line field in the points-to-line tool and at run time this throws the updateparams exception as the xyevent layer is not created yet.

I tried using copyfeatures and wrote the eventlayer to a featureclass but still unable to get it to work.

how can i use the points-to-line tool in a model if i have a text file as input?

I have attached a toolbox containing the model and the input shapes.txt.

Thanks
Anand
0 Kudos
2 Replies
ElenaLopez
Deactivated User
Hello,

I have the same problem with the POINT TO LINE tool in model builder.

After using the Feature to Point tool I try to use the Point to Line tool and an error occurr. How can I solve this ?? I think is a problem with the model builder becasue the tool works perfectly if I do it directly in the map view.

MY MODEL: Spatial Join - Select - Make Feature Layer - Select by attribute - Add Field - Calculate Field - Feature to Point - POINT TO LINE (Error message).

Any help will be much appreciated !

Thank you,
Elena
0 Kudos
HollyGolvach
Deactivated User
Hi,

I have a text file containing coordinates in sequences (shapes.txt) that can be used to construct a line layer. I can do it successfully if i first convert shapes.txt into a point feature class and the use the points to line tool to get a line feature class.

However, if i try to do the same in modelbuilder by using the same processes and i get an update parameters error. This is because I am using "make xy event layer" tool to get a temporary point layer and then feeding it to points-to-line tool. The problem i guess here is i need to select the sort field and line field in the points-to-line tool and at run time this throws the updateparams exception as the xyevent layer is not created yet.

I tried using copyfeatures and wrote the eventlayer to a featureclass but still unable to get it to work.

how can i use the points-to-line tool in a model if i have a text file as input?

I have attached a toolbox containing the model and the input shapes.txt.

Thanks
Anand


Hi,

I'm doing something similar, so I just watched a video about model builder about an hour ago.

When I imported your toolbox, I viewed your model in Edit mode. I'm not sure if you've already checked these things on your end,  but when I looked at the model, these are the things that were missing upon import:

1. Model Properties --> Environments --> Workspace (needs a check mark in the box) --> then, you probably need to define where you want your workspace AND your scratch (because of the temporary nature of XY data to points.)

2. Shapes.txt --> Properties --> Data Type --> (I think you should select text file)

So, I don't know much about what the "Field Type" of your Data Fields (X and Y) should be set to, but there is an option to set them to "Any Value", which might be appropriate since you're converting from a text file... it might not consider comma or tab delimiting as "fields" ---but I don't know this for sure, it was just something I considered might help.

If none of this works, or you've already tried it--apologies! 🙂

Good luck,
Holly
0 Kudos