POST
|
Hi, will this script assist identifying the front of a house?
... View more
04-28-2016
07:53 AM
|
0
|
0
|
1072
|
POST
|
Issue solved. The script was working but for some reason the field storing the time difference got renamed with an underscore at the end. After removing it, the script is working as expected. The datetime module was not required since it is included as part of the python functions within the Field Calculator GUI. I really appreciate your assistance Dan. Good day.
... View more
04-28-2016
05:31 AM
|
0
|
1
|
1286
|
POST
|
Thanks for the info... I was just checking out your blog I will try to run the same process with a File GDB in order to isolate the issue. If it does work, I will report it here for the record.
... View more
04-27-2016
10:40 AM
|
0
|
3
|
1286
|
POST
|
No, the arcpy module was not imported when using the Field Calculator. If needed, can you provide an example of how to? BTW, I found it odd that it is needed since I already tested it before within the Field Calculator wand I don't recall adding the import module part.
... View more
04-27-2016
07:56 AM
|
0
|
1
|
1286
|
POST
|
Yes, I am working on a python IDE. When executed from the IDE, it says in runs but the record is not updated in the Time_Diff field. That is why I went to the field calculator to just test the script which was working last week. This is a simple script that used to update one of the widgets in a dashboard. # Import arcpy module
import arcpy
conn = r"C:\Users\gispu\Documents\GIS_Python_Scripts\Map_Change_Request\GISHW.sde"
arcpy.env.workspace = conn
# Local variables:
Input_MapChangeRequest = r"C:\Users\gispu\Documents\GIS_Python_Scripts\Map_Change_Request\GISHW.sde\gishw.PU.HW_FieldCollection\gishw.PU.MapChangeRequest"
MapChangeRequest_Layer = "PU.MapChangeRequest_Layer"
MapChangeRequest_Layer2 = MapChangeRequest_Layer
PU_MapChangeRequest_Layer = MapChangeRequest_Layer2
# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(Input_MapChangeRequest, MapChangeRequest_Layer)
# Process: Select Layer By Attribute
arcpy.SelectLayerByAttribute_management(MapChangeRequest_Layer, "NEW_SELECTION", "STATUS = 'Open' OR STATUS = 'Validation'")
# Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(conn)
# Edit session is started without an undo/redo stack for versioned data
edit.startEditing(True)
# Start an edit operation
edit.startOperation()
# Process: Calculate Field
arcpy.CalculateField_management(Input_MapChangeRequest, "Time_Diff", "(datetime.datetime.now() - arcpy.time.ParseDateTimeString( !DATE! )).days", "PYTHON_9.3", "")
# Stop the edit operation.
edit.stopOperation()
# Stop the edit session and save the changes
edit.stopEditing(True) EDIT: 2016-04-28 The above script is good and works as expected.
... View more
04-27-2016
07:43 AM
|
0
|
3
|
1286
|
POST
|
I have a python script that used to work to calculate difference in dates outputting the result in days. It worked fine since last week until we migrated to 10.4. To my understanding, this should not matter but just as en extra info. (datetime.datetime.now() - arcpy.time.ParseDateTimeString( !DATE! )).days The following error is returned: Executing: CalculateField gishw.PU.MapChangeRequest Time_Diff (datetime.datetime.now() - arcpy.time.ParseDateTimeString( !DATE! )).days PYTHON_9.3 # Start Time: Wed Apr 27 10:24:54 2016 ERROR 000539: Error running expression: (datetime.datetime.now() - arcpy.time.ParseDateTimeString( u"4/26/2016 4:10:00 PM" )).days Traceback (most recent call last): File "<expression>", line 1, in <module> NameError: name 'arcpy' is not defined Failed to execute (CalculateField). Failed at Wed Apr 27 10:24:54 2016 (Elapsed Time: 0.13 seconds) Any assistance will be appreciated.
... View more
04-27-2016
07:31 AM
|
0
|
10
|
4014
|
POST
|
Garrett McKinney When is this class going to be available?
... View more
04-19-2016
01:07 PM
|
0
|
2
|
3351
|
POST
|
It did worked as expected in IE 11. I have not tried in Firefox though nor any other option. Chrome definitely is not working for me...unfortunately since it is my prefer browser.
... View more
04-15-2016
09:36 AM
|
0
|
1
|
445
|
POST
|
I am using Portal. I have created a dashboard but is not yet shared with anyone from my organization. When testing the dashboard from the web, after asking me for my credentials and entering them correctly, the dashboard never opens. It returns back to the login page. Am I missing something? I tested this only with Chrome
... View more
04-06-2016
11:59 AM
|
0
|
3
|
3536
|
POST
|
Yes Well, it appears it was not. I assumed it got unversioned after adding a new feature class to the Feature Dataset. Is that correct? Now, the script works as expected. Thanks a lot!
... View more
04-06-2016
07:21 AM
|
0
|
0
|
4436
|
POST
|
It returns the following error even though I have enabled the editing within the script... arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Objects in this class cannot be updated outside an edit session [gishw.PU.MapChangeRequest] Failed to execute (CalculateField).
... View more
04-06-2016
06:28 AM
|
0
|
1
|
4436
|
POST
|
I have modified the script so that it point to the SDE connection locally for the workspace but still I get the same runtime error... any help will he really appreciated . The SDE connection used in the script points to the version where I need to update the data. # Import arcpy module
import arcpy
conn = r"U:\GIS\GISHW.sde"
arcpy.env.workspace = conn
# Local variables:
Input_MapChangeRequest = r"U:\GIS\GISHW.sde\gishw.PU.HW_FieldCollection\gishw.PU.MapChangeRequest"
MapChangeRequest_Layer = "MapChangeRequest_Layer"
# Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(MapChangeRequest_Layer)
# Edit session is started without an undo/redo stack for versioned data
edit.startEditing(True)
# Start an edit operation
edit.startOperation()
# Process: Calculate Field
arcpy.CalculateField_management(MapChangeRequest_Layer, "Time_Diff", "(datetime.datetime.now() - arcpy.time.ParseDateTimeString( !DATE! )).days", "PYTHON_9.3", "")
# Stop the edit operation.
edit.stopOperation()
# Stop the edit session and save the changes
edit.stopEditing(True) Jake Skinner I noticed you commented on a similar question and thought you may be able to assist me with this issue. Thanks in advance
... View more
04-06-2016
06:04 AM
|
0
|
3
|
4436
|
POST
|
I just added the following below Import arcpy and got the same error: arcpy.env.workspace = "Database Connections\\GISHW.sde\\gishw.PU.HW_FieldCollection"
... View more
04-04-2016
12:26 PM
|
0
|
2
|
4436
|
Title | Kudos | Posted |
---|---|---|
1 | 11-19-2014 07:02 AM | |
1 | 02-06-2014 08:06 AM | |
7 | 02-13-2016 08:12 AM | |
1 | 02-16-2015 08:10 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|