|
POST
|
There should be a "Use advanced editor" link in the upper right corner of the reply box. What browser are you using? Re: How to format a code sample on GeoNet?
... View more
03-04-2015
08:28 AM
|
0
|
3
|
1393
|
|
POST
|
Your link is doubled up. I think you meant to go to ArcGIS Help 10.2 - Workspace properties (arcpy)
... View more
03-04-2015
07:58 AM
|
0
|
1
|
1393
|
|
POST
|
Thanks for posting your code, but a screenshot is not very helpful if someone wants to copy it. Please post again as text with Python syntax highlighting. Posting Code blocks in the new GeoNet
... View more
03-04-2015
07:55 AM
|
0
|
0
|
1393
|
|
POST
|
I haven't seen anything that will let you release specific locks like that. I think the best you can do is just disconenct the user from SDE. However, you should disconnect all users for a compress anyway. If you have a different script that needs access to a particular table, you could use the Registration_ID from SDE.Table_Registry table to find any locks on it in the SDE.Table_Locks table. If there are locks listed for that table, you could take the SDE_ID of the lock(s) and use DisconnectUser() to kick just that person (or persons) with the locks. You can get detailed connection information about a particular SDE_ID in the SDE.Process_Information table or with ListUsers(). You can query all these SDE tables with arcpy using ArcSDESQLExecute().
... View more
03-03-2015
11:09 AM
|
1
|
1
|
1091
|
|
POST
|
Might be better (cleaner) to use string format(). Based on the correct answer from Darren Wiens, this is what I would do. counter = 0
with arcpy.da.UpdateCursor(table, [field]) as cursor:
for row in cursor:
if row[0] == find:
row[0] = replace
cursor.updateRow(row)
counter += 1
print "{} items processed".format(count)
return counter
... View more
02-27-2015
03:42 PM
|
0
|
0
|
2346
|
|
POST
|
The version has to be created as Public or Protected if you are not the owner and need to view it. If the version is Private, you have to be the owner. ArcGIS Help 10.2 - Creating versions and setting permissions
... View more
02-27-2015
10:38 AM
|
1
|
1
|
3083
|
|
POST
|
Oh, so the version you make is created under another version that has changes you want to see? Were you using arcpy.ChangeVersion_management() to change versions? Can the changes in the parent version be posted up so you can just do the script work on Default?
... View more
02-27-2015
10:29 AM
|
0
|
4
|
3083
|
|
POST
|
Try reconciling the version before you delete it. However, I still don't understand the requirement to do this work in a version if you're only selecting features and exporting them. If you are not editing geometry or attributes, I don't think you need a version.
... View more
02-27-2015
10:19 AM
|
1
|
7
|
3083
|
|
DOC
|
Thanks for the new download. I'm trying to read through the code and I noticed there are no real comments! Looks like your test code at the bottom had comments though. Even some basic comments would be helpful, especially if you plan to share your code.
... View more
02-20-2015
02:31 PM
|
1
|
0
|
2284
|
|
POST
|
There are some basic examples in the Esri help documentation ArcGIS Help 10.2 - SearchCursor (arcpy.da) For your particular code, it's as simple as just starting with the cursors in nested with statements and removing the del lines afterwards. with arcpy.SearchCursor(r"C:\gishome\tasks\flood_warning_system\jetConnectForDvLive.odc\last3days") as accessRows:
with arcpy.InsertCursor(r"C:\gishome\tasks\flood_warning_system\_SPW_GDBMGR@GIS_PW_SWM.sde\tblGageData") as curSde:
for cRow in accessRows:
# Loop through the results returned via the OLE DB connection
##
#Insert a new row into the SDE table with the current DIADvisor record's information
##
print "Number of record(s) in the DIADvisor database: " + str(counter)
print "Processing end time: " + str(datetime.now())
... View more
02-20-2015
02:23 PM
|
1
|
1
|
2084
|
|
POST
|
I second this. Use the arcpy.da module for cursors and use them in a with statement so the cursors are automatically deleted even if there was an error. Your current code may not delete the cursors if there was an error.
... View more
02-20-2015
02:01 PM
|
0
|
3
|
2084
|
|
DOC
|
I don't see a .esriaddin file included in your .zip download.
... View more
02-19-2015
02:28 PM
|
0
|
0
|
2284
|
|
DOC
|
A potential use might be to decide which tool to use on the fly (maybe while iterating through a geodatabase with arcpy.da.walk) depending on if you're looking at a table or a feature class. Like make a feature layer or a table view. Still don't know what particular use case would require that. I'm sure someone's needed this though!
... View more
02-19-2015
01:28 PM
|
0
|
0
|
2235
|
|
DOC
|
That is pretty nifty. It took me a moment to realize it's dynamic in that the code can dynamically choose the tool to run (based on some logic) rather than getting dynamic input from the user. And when you say unpack the arguments, you're referring to the items in the list. If your tool only has one argument, I found you can pass it just bare (without the list) if you get rid of the asterisk. But that is just me experimenting, your way is recommended since it will accommodate all cases. Thanks for the post!
... View more
02-19-2015
01:10 PM
|
0
|
0
|
2235
|
|
POST
|
It doesn't sound like you are doing any edits (step 2.3 and 2.4), but are you starting an edit session in there anywhere? ArcGIS Help 10.2 - Editor (arcpy.da) If yes, are you explicityly stopping the edit session? If no, why do you need to create a version for read-only operations? EDIT: Just to verify your code works, try a simplified version of your script that just creates the version and then deletes it. Then scale it up to create the version, switch to it, switch back to Default, then delete the version. The success or failure of these actions might help troubleshoot the problem.
... View more
02-19-2015
12:47 PM
|
0
|
9
|
3084
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | 07-31-2025 11:59 AM | |
| 1 | 07-31-2025 09:12 AM | |
| 2 | 06-18-2025 03:00 PM | |
| 1 | 06-18-2025 02:50 PM |