|
POST
|
So essentially you're saying you want to convert your dynamic text to Annotation, or something like that. Is that correct? I'm not sure this can be done, since only the TextElement class has a text property. Dynamic text is more like html than text. As for Arc crashing, it may have something to do with the defense solution. Not familiar with that, but never had a problem with crashes in a regular Arc setup.
... View more
10-28-2014
12:07 PM
|
0
|
4
|
1845
|
|
POST
|
I think if you converted them to graphics or ordinary text you'd lose the 'dynamic' aspect where they change based on the various criteria (page, date, etc.). Some, like title, don't need to be dynamic, so you may be able to use plain text for those. I'm not sure ListLayoutElements considers dynamic text a retrievable element, but you might try leaving out "text_element" and just call it on the mxd, see if you get anything back. ESRI help doesn't mention whether dynamic text is returned or not, as far as I can tell. The best I can find is the statement 'Dynamic text is only supported for graphic text on the layout.' in the note on this page, which suggests it may be considered a graphical element. But I don't know for sure.
... View more
10-28-2014
10:37 AM
|
0
|
0
|
1845
|
|
POST
|
That's great Walter, thanks, much appreciated. I'll keep a look out for it
... View more
10-28-2014
10:23 AM
|
0
|
0
|
868
|
|
POST
|
FYI, based on Miguel's research, here's a modified version of the StreetIndexReport.py that will print in 11x17" size when in landscape mode. One thing that tripped me up for a while was that pdfs measure from the bottom left, not top like I assumed. So if you need to modify settings, keep that in mind. Also Miguel, I think you could modify pagesizes.py to add your custom size. Throw it under line 25:
LETTER = (8.5*inch, 11*inch)
LEGAL = (8.5*inch, 14*inch)
ELEVENSEVENTEEN = (11*inch, 17*inch)
MYCUSTOMSIZE = (11.75*inch, 15.75*inch)
Then replace letter with MYCUSTOMSIZE in the script for the tool. Not tested, but that seems like it should work. Then play with page settings to place your elements. It might help to print a sample page and then use a ruler to figure out where you want them.
... View more
10-28-2014
09:33 AM
|
0
|
0
|
1872
|
|
POST
|
This thread was very helpful in changing the default page size for the Create Street Index Report in the Fire Run map book from letter size to 11x17. What I'd like to know is if there's a way add address ranges to the index along with page numbers. Something like the image below. Thanks. From this: To this:
... View more
10-28-2014
05:30 AM
|
0
|
2
|
3844
|
|
POST
|
In the Python window in ArcMap, you will definitely need the r before "C:\ArcGIS\...". If you don't use r, you'll have to either use double back slashes - "C:\\ArcGIS\\..." or use forward slashes - "C:/ArcGIS/...". Python treats a single backslash in a string as an escape character, e.g. "\n" = newline, "\t" = tab, etc. Although in the Python window you're generally working with the mxd you have open, so "CURRENT" is correct there. Not sure why you're failing on lyr.dataSource, unless there's a typo somewhere. dataSource is a valid layer property. Is your shapefile in a group layer by chance?
... View more
10-22-2014
12:32 PM
|
0
|
3
|
5493
|
|
POST
|
I'd put the calculation expression in a variable and check that. It kind of looks like your quotation marks are off, but honestly it's a bit hard to follow all that.
... View more
10-22-2014
05:47 AM
|
0
|
3
|
1837
|
|
POST
|
Ok, well sure, beat me to a more elegant solution . The only caveat is if the OP isn't calculating a field, but getting the results for another process, as part of a more complex script. But your answer seems the most likely and best.
... View more
10-14-2014
04:33 PM
|
1
|
0
|
4231
|
|
POST
|
Hi Narayan. The script you want, or at least the formula you gave, is pretty simple.
def CalcRatio(len, area):
return len/area
The differences in how you call this depend on whether you want to call this in Field Calculator or a stand alone script. In FC, set the parser to python and check the show codeblock box. Enter the above code in the pre-logic box, and in the field = box call the function as shown below (obviously use your own field names, not my example). You'd use the same def in a stand alone script, but the method for getting the field values for length and area are a little different. If that's what you want, post back and we can go through that.
... View more
10-14-2014
04:27 PM
|
0
|
0
|
4231
|
|
POST
|
Using arcpy.da, you can retrieve the fields by index. Arcpy.da SearchCursors return tuples. So, in the code below, you'd retrieve values by index; you don't use getValue.
# create list of field names you want returned. This is faster if you don't want all fields.
# optionally, you could skip this (and leave fldList out of SearchCursor call below)
# if you did want all fields. Use an asterisk instead of fldList in that case.
fldList = ['fieldone', 'fldFive']
with arcpy.da.SearchCursor(tempSHP, fldList) as rows:
for row in rows:
print row[0] # prints value of fieldone in first record, then second, etc
print row[1] # prints value of fieldfive in first record, then second, etc
Also note in the help link above that various shape field properties can be accessed by tokens instead of field names, and that none of this works on raster fields.
... View more
10-14-2014
05:08 AM
|
0
|
0
|
3384
|
|
POST
|
There are a couple ways, depending on your data. Is the format consistent? In Field Calculator (parser set to Python), one way is this, where <yourfield> is your field name:
<yourfield>.split()[0]
This will return the part of the string before the first space, e.g. IH0045. split() takes the whole string and breaks it into a list using a space to break the elements of the string as a separator. [0] references the first element of the list. You could give split() an argument and break on that if a space isn't what you want. For example, split('4') would give you the list ['IH00', '5 - KG'}. The 4 in this example, and the space in the first, are not part of the list. If your data is not in a consistent format, or what you want removed is not consistent, this may not give you what you want. That would be a more complex operation that would depend on the data.
... View more
10-10-2014
12:54 PM
|
0
|
0
|
2402
|
|
POST
|
Not up much on Javascript, but it sounds like what you want is a search, not a geocoder per se. You might have better luck with this question in the Javascript forum.
... View more
10-10-2014
09:58 AM
|
0
|
0
|
577
|
|
POST
|
I've never used Model Builder, preferring straight python, but here's a python function to do what you want:
def CalcField(zone):
risk = ''
if zone in ('A', 'AE', 'AH', 'AO'): risk = 'High'
elif zone = 'Whatever': risk = 'Moderate'
elif zone = 'X': risk = 'Low'
else: risk = 'somedefaultvalue'
return risk
You want that last else in there to handle any cases that don't match the previous criteria, especially Null values. Call the function, passing in FLD_ZONE. There is a CalculateField GP tool that I'd assume is available in Model Builder, but as I said, not familiar with MB, so not sure how that would integrate. Anyway, use what you can from the above. Here's a good example from ESRI (3rd example, Calculate Ranges).
... View more
10-10-2014
07:43 AM
|
1
|
9
|
3584
|
|
POST
|
What kind of database is this in? I think the bigger problem is having a Null ObjectID. You might see a jump like this if you deleted a bunch of records. New features don't then start numbering ObjectID after the last existing value, they start after the last one used, even if it's now deleted. So in your example, if you'd deleted records with ObjectIDs from 236 - 633, the next ObjectID would start at 634, not 236. This is a general rdbms rule; specific dbs might implement this differently.
... View more
10-10-2014
05:33 AM
|
0
|
0
|
790
|
| Title | Kudos | Posted |
|---|---|---|
| 6 | 08-22-2019 07:41 AM | |
| 1 | 05-05-2014 04:30 AM | |
| 1 | 08-15-2018 06:23 AM | |
| 3 | 08-06-2018 07:31 AM | |
| 1 | 03-30-2012 08:38 AM |
| Online Status |
Offline
|
| Date Last Visited |
12-12-2021
01:00 PM
|