0

I'm trying to build model which create from XY values lines two times and then loop through them to extend each of them individually and merge them back. I built two models: 'main model' that creates lines from XY values, calls support model and merges lines back.

Main model

And another 'support model' which loop through my lines and extend them (or should be doing it).

Support model

My problems:

  • support model extend each line, create output but not allow me to merge lines with the same name

  • cannot merge my looped left and right lines back,

  • looping is quite slow (for 150 lines it takes about 15 min).

I assume there is a problem with the output from support model but I don't know how to fix it.

I figure out that i need to collect my output which generates me output lines but with the same name. Now I'm trying to push nr to the end of each name and strange thing start to happening.

Name change

I calculate name for each line adding %output_value% at the end of copy feature output but its still grey. I added also connection as precondition but it won't help. When i run model inside model builder it works, i see that it gives my shapefiles new names but it not generates output. In the other hand when i run model through geoporacessing it creates "ERROR 0008000 - The value is not a member of ." I tried also with parse path but it creates same error.

Any ideas how to solve it?

  • You think that problem is in support model. So.. did you try to debug it? Take feature class with couple of lines and give it to the model as an input. Is result ok? – Maxim Jan 18 '17 at 13:58
  • i tried to debug it, i got output now, but i cannot create new names for each lines – Losbaltica Jan 19 '17 at 11:42
1

I tried to debug it with a couple of lines and it change it but i cannot get the output

At the end I created script which extend the lines for each row,

  #extending each row
  def shift_features(inFC):
      with arcpy.da.UpdateCursor(inFC,["OID@", "SHAPE@"]) as sCursor:       
          for row in sCursor:
               arcpy.ExtendLine_edit(inFC, "2 Meters", "EXTENSION")

      return

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.