POST
|
Thank you for responding! I will look into that. I was hoping for a more elegant solution as there are already over 10,000 orders (after we already cut 70% of the points out), and some of my orders require as many as 4 deliveries per week. But I will experiment and see what works. Do you have any tips for implementing this work-around? David
... View more
05-09-2017
11:49 AM
|
0
|
1
|
462
|
POST
|
Hello GeoNet, I am working on a complex Vechicle Routing Problem (VRP) that involves 'orders' getting multiple deliveries per week (as low as 1 delivery per 2 weeks to as high as 4 deliveries per 1 week). I am working to incorporate date and time information in the orders, but I cannot find a way to put in more than one per week. Is there a way to do this? Thank you! David South
... View more
05-08-2017
03:35 PM
|
0
|
3
|
1418
|
POST
|
Curtis, thank you for the effort you have taken to help me. The code now works! Giving it the .dbf extension seems to have done the trick! Thank you so much to everyone who has helped!
... View more
04-24-2017
05:06 PM
|
0
|
0
|
187
|
POST
|
Hello Curtis, Thank you for the response. I have changed my code to look like this: ##########setup###########
import arcpy, os
from arcpy import env
##########parameters##########
ws = r'C:\Users\ddsouth\Documents\Python_tests'
env.workspace = ws
newFile = "adding_table_rows_test_3"
###########code###############
#create the table
tbl = arcpy.CreateTable_management(ws, newFile)
tv = arcpy.MakeTableView_management(tbl, "tv")
arcpy.AddField_management(tv, "RouteName", "TEXT", "", "", 15)
arcpy.AddField_management(tv, "DepotName", "TEXT", "", "", 15)
#edit the table
cursor = arcpy.da.InsertCursor(tv, ["ROUTENAME"])
for q in range (0,10):
cursor.insertRow((str(1),))
del cursor
#clean up tv
arcpy.Delete_management(tv) print "Completed." Yet I still get the error on the "cursor.insertRow((str(1),))" line: Runtime error ... SystemError: error return without exception set Is there a way to fix this? I really appreciate the help.
... View more
04-21-2017
01:32 PM
|
0
|
4
|
1122
|
POST
|
Thanks, I will remember this for next time. I am still getting used to how this site works.
... View more
04-21-2017
01:21 PM
|
0
|
0
|
1122
|
POST
|
I am having problems when using ArcPy with ArcGIS Desktop to add in a set number of rows into a .dbf table. What should I do to prevent these errors? Here is a sample code that gives me errors: ##########setup###########
import arcpy, os
from arcpy import env
##########parameters##########
ws = r'C:\Users\ddsouth\Documents\Python_tests'
env.workspace = ws
newFile = "adding_table_rows_test_5"
newFileFull = os.path.join(ws, newFile) + ".dbf"
###########code###############
#create the table
arcpy.CreateTable_management(ws, newFile)
arcpy.AddField_management(newFileFull, "RouteName", "TEXT", "", "", 15)
arcpy.AddField_management(newFileFull, "DepotName", "TEXT", "", "", 15)
#edit the table
cursor = arcpy.da.InsertCursor(newFile, ["ROUTENAME"])
for q in range (0,10):
cursor.insertRow((str(1),))
del cursor
print "Completed." The creation of the table goes fine the first time, then when it comes to the edit portion I get the following error message: Runtime error Traceback (most recent call last):
File "<string>", line 26, in <module>SystemError: error return without exception set Then if I run the program again, I get a different error, this time during the creation of the table, even if I have the "Overwrite the outputs of geoprocessing operations" option selected: Runtime error Traceback (most recent call last):
File "<string>", line 18, in <module>
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py",
line 15715, in CreateTable
raise e ExecuteError: ERROR 001143: Background server threw an exception. I also noticed that while the tables I created appear in ArcCatalog, they do not appear in Windows Explorer, there is only a LOCK file while ArcMap is open. What should be done? Thank you!
... View more
04-20-2017
04:07 PM
|
0
|
11
|
1820
|
POST
|
While I realize that I am about 7 years too late to help you, this comment may potentially help someone else with the same issue so I decided to respond. If this happens, take a look at how you set the problem up. My guess is that you set a variable to the wrong attribute, such as 'label' as Distance or Time Attribute, etc. This could also be a problem with your roads data. Some datasets are better than others, and yours could have been of poor quality or a compilation of several datasets, resulting in some streets that don't quite match up or intersect like they should. Third, double check the input data that everything is exactly where you would expect it to be. There could be conversion errors as you converted from file types or geographic coordinate systems etc. I hope this will help someone else who has a similar problem!
... View more
03-16-2017
01:09 PM
|
0
|
0
|
268
|
POST
|
Hello GeoNet, I am working on a large Vehicle Routing Problem (VRP) for a number of depots and orders all across Michigan. Thus far I have been manually doing the VRP, adding Routes manually via 'Add Item' and changing its specifics. The sheer number of Routes and Route Renewals makes the task of doing this across all of Michigan essentially impossible. I have some minor experience with ModelBuilder, but I am having difficulty automating the process. Ideally, the computer would automatically add a number of Routes and Renewals based on values in the attribute table of the Depot (some have only 1 truck for deliveries, some have multiple, etc). Is it possible to do what I need with ModelBuilder, or is another tool better? How should I go about doing this? Thank you in advance.
... View more
03-16-2017
12:22 PM
|
0
|
1
|
1323
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|