|
POST
|
I too get this behaviour. I get around it by creating the table view in this manner. arcpy.MakeTableView_management(data, table, 'OBJECTID < 100') As opposed to this, if this is how you are doing it. table = arcpy.MakeTableView_management(data)
table.definitionQuery = 'OBJECTID < 100'
... View more
09-17-2013
01:59 PM
|
0
|
0
|
991
|
|
POST
|
What does text = '{0} {1} {2} denote? That is the preferred method of string concatenation. Each number marks the index of the value being inserted into the string ordered by the format call. It would be helpful if you provided an example of the text you are working with, where you want to split it, and how many text elements you want to span.
... View more
09-12-2013
05:31 AM
|
0
|
0
|
1973
|
|
POST
|
How I would do it is take all the text out into on variable then split it up however I'd need to. Something like this. text = ''
cursor = arcpy.SearchCursor(Project)
for row in cursor:
text = '{0} {1} {2} '.format(text, str(row.Overview).strip(), str(row.Project).strip()) It would depend on how your text is organized, how much there is, and how you want to display it.
... View more
09-11-2013
01:29 PM
|
0
|
0
|
1973
|
|
POST
|
Here is another thread that goes through splitting field values between text elements. http://forums.arcgis.com/threads/90554-Text-Element-Questions You'll probably want to create a list of your text separated into the chunks you want and then iterate through them putting them in the required text elements.
... View more
09-11-2013
08:53 AM
|
0
|
0
|
1973
|
|
POST
|
Do you want it on a separate text element or a different line in the same text element? You can do some simple string splicing to get at most a specific length. Here is an older post about word wrapping. You can use a similar method just moving to the next text element instead of the next line if you truly want to separate them. http://forums.arcgis.com/threads/62418-Text-Formatting-in-Python?p=215891&viewfull=1#post215891
... View more
09-11-2013
08:17 AM
|
0
|
0
|
1973
|
|
POST
|
Something like this would get what you want I believe. Depends on what you are doing specifically if it is in a dataset or not. import os
import arcpy
mxd = mxd = arcpy.mapping.MapDocument('current')
layer = arcpy.mapping.ListLayers(mxd, 'some_layer')[0]
describe = arcpy.Describe(os.path.dirname(layer.dataSource))
ws_type = describe.dataElementType
if ws_type == 'DEFeatureDataset':
print('is in dataset')
elif ws_type == 'DEWorkspace':
print('is not in dataset')
else:
print('unknown datatype')
pass
... View more
09-10-2013
09:10 AM
|
0
|
0
|
3731
|
|
POST
|
Your "Database Connections" folder is user specific ("%APPDATA%\ESRI\Desktop10.1\ArcCatalog"). When dealing with servers it is best to store them in a location all users can access. Otherwise you will run into issues if another user or the system attempts to execute the script they won't be able to find that location.
... View more
09-10-2013
07:37 AM
|
0
|
0
|
2883
|
|
POST
|
I would avoid using mdbs at all costs. You will run into nothing but trouble unless you need them for a very specific purpose. That may or may not be the cause of your current issues but it is a good place to start.
... View more
09-10-2013
07:31 AM
|
0
|
0
|
2259
|
|
POST
|
Your code works for me. Are you sure the two fields exist in your source table?
... View more
09-10-2013
07:10 AM
|
0
|
0
|
2259
|
|
POST
|
Can you post all your code? Are you sure the connection file exists in that location? Are you attempting to run this as a service/task while not logged in? Also, please read this on posting code. http://forums.arcgis.com/threads/48475-Please-read-How-to-post-Python-code
... View more
09-10-2013
05:13 AM
|
0
|
0
|
2883
|
|
POST
|
I would look at the zonal statistics tool, or use intersect/spatial join/identity then dissolve with a sum option.
... View more
09-03-2013
09:29 AM
|
0
|
0
|
1523
|
|
POST
|
How are you inputting your xMin, yMin, etc. values into your script? Are they manually entered or automatic from your layer? What specifically are you trying to isolate as your extent? Also. http://forums.arcgis.com/threads/48475-Please-read-How-to-post-Python-code
... View more
08-27-2013
05:29 AM
|
0
|
0
|
2093
|
|
POST
|
Your code runs without error for me. What version of ArcGIS are you using?
... View more
08-19-2013
11:52 AM
|
0
|
0
|
1432
|
|
POST
|
That has me thinking of two questions. Does the layer being searched have to be the index layer? I imagine that it doesn't. Also, is pageName only a number? I haven't seen anywhere that getPageIDFromName actually returns the string of the field attribute but returns a number based on the sort order of the DDP. getPageIDFromName returns the numeric PageID with the string of the field attribute as the input. And yes, the layer being searched must be the ddp index layer. To search another layer, as I said, you will have to get creative with how they are related to each other; either spatially or tabularly.
... View more
08-19-2013
07:59 AM
|
0
|
0
|
1724
|
|
POST
|
Sorry I had misunderstood, your pageID variable is the value of the field, I had thought it was the field name. So yes you are right. PageID is supposed to be the field being searched and Intersec supposed to be the value of that field in the row. As your input you assign pageNum as the variable, this is supposed to be the page name but maybe you just have the page name set as a number? Based on how I understand your code, I think this is what you want to be doing. import arcpy
pageNum = arcpy.GetParameterAsText(0)
ddp = mxd.dataDrivenPages
arcpy.AddMessage(pageNum)
pageID = ddp.getPageIDFromName(str(pageNum))
ddp.currentPageID = pageID
rows = arcpy.SearchCursor(mapLyr, "{0} = {1}".format(ddp.pageNameField.name, pageNum)) That is assuming you are passing the page name as your parameter (pageNum). That is also assuming you are accessing the ddp layer in your cursor, if you are trying to access some other layer that would require some more creative solutions.
... View more
08-19-2013
06:05 AM
|
0
|
0
|
1724
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|