Setting default names for stops

602
2
04-28-2011 03:19 AM
Highlighted
New Contributor
Hello all,

I need to change names of stops/barriers from default GraphicPick1, GraphicPick2... to something more appropriate. It is easy to set default value for Name property in route layer properties but is it possible to set increasing index for every new loaction (for instance: Point1, Point2, Point3...).

Thanks for any help
Tags (2)
Reply
0 Kudos
2 Replies
Highlighted
by
Occasional Contributor
Hi,

In ArcMap, you can open the Geoprocessing->Python window to execute the following python scripts to change the names. Just copy and past the code into the python window and click the Enter button.

rows = arcpy.UpdateCursor("MyRoute\Stops")
for row in rows:
         currentName = row.getValue("Name")
         newName = currentName.replace("Graphic Pick", "Point")
         row.setValue("Name", newName)
         rows.updateRow(row)


Thanks.

Anna
Reply
0 Kudos
Highlighted
New Contributor
Hello Anna,

Thank you for answering. Script you sent is OK but what I need is that points are named automatically when user adds stop on the map. This way, when user adds stop at the map, stop gets default name (Graphic Pick1, Graphic Pick 2...) and after that script needs to be started in order names to be changed.
Entering default name in route properties raises a problem that all stops are named identically and that can be confusing for users.

Thanks,
Boban
Reply
0 Kudos