Modelbuilder - make user-generated points 1st and last in route sequence

01-16-2015 11:42 AM
New Contributor II

I have about 800 points, in 26 category groups (A to Z). Each category group represents a 'run' or 'route' of stops. What I want my model to do is allow the user to define (by clicking on the map) a start and end location and then solve one of the routes (keep the user-generated points in the 1st and last spots, and reorder the others to the ideal route). So when the model is run...

The dialogue box should ask the user for the Run Name and then to click two locations on the map. Then, it should somehow make the two user-selected locations the 1st and last stops in the sequence and solve the route. Any ideas?


0 Kudos
2 Replies
Esri Regular Contributor

It think you can accomplish this in your model as follows:

- Make Route Layer - configure it to find the best order (rather than using input order) but to preserve both the first and last stops.  That way the first and last one will remain first and last, but the middle ones will reorder for the optimized route. See ArcGIS Help (10.2, 10.2.1, and 10.2.2)

- Add Locations 1 - your user's first selected stop (the starting point)

- Add Locations 2 - all the intermediate stops that you already know

- Add Locations 3 - your user's second selected stop (the end stop)

- Solve

0 Kudos
New Contributor II

Cool, thanks! I was able to do it in a pretty similar way.

- I added a "Sequence" field, made the start point "1", the end point "3" and the rest "2"

- Then I put in a Sort to make sure the 1 ends up at the beginning and the 3 at the end (realized afterward that you can do this in the Route Analysis window so probably will redo to make cleaner)

- Then solved while preserving first and last and it works great

0 Kudos