POST
|
# I have the current sheet as a parameter. This is going to be your grid sheet/page. You will need a copy of the layer you are using for data driven pages, open the properties -> Definition Query and set up the Page Definition.
CurrentSheet = arcpy.GetParameterAsText(0)
Selection = arcpy.SelectLayerByLocation_management(TRAFFICSIGNS, "INTERSECT", CurrentSheet)
# TextElement = the Element Name
TextElement.text = Selection
ddp.exportToPDF("C:LOCATION", "CURRENT")
finalResult.appendPages("C:LOCATION")
... View more
11-23-2015
07:18 AM
|
1
|
0
|
1715
|
POST
|
No the extent was good, the results were ok but you could see it was missing a lot for the range I wanted of steep slopes. When looking at and calculating the slope from the contours and comparing that to the slope calculated using the tool it did not match up. I figured out that the Raster cells were just too big (30m), I got the cell size down to 3m and the results were a lot better.
... View more
10-05-2015
04:05 AM
|
0
|
2
|
2225
|
POST
|
I think I was just over thinking it. The reason is because the slope raster does not match up with the topo that was generated using the same raster and I don't know why.
... View more
10-01-2015
09:08 AM
|
0
|
4
|
2223
|
POST
|
I might be over thinking this but how do I get my slope, created using percent_rise output, to classify by the actual %? The way I understand using the Classified Symbology it classifies by the percentile of my values range for the raster, NOT the percent slope. So how do I get it to symbolize by the actual percent rise value?
... View more
10-01-2015
07:17 AM
|
0
|
6
|
6535
|
POST
|
Thanks for the tip! This is exactly what I will do, if I do not find a way to do it without replacing.
... View more
08-05-2015
07:58 AM
|
0
|
1
|
1550
|
POST
|
It still runs fine, but the results of my list in the text element are <BOL>002:</BOL> Jeff & Jane Smith - 67890 instead of 002: Jeff & Jane Smith - 67890. If there just 1 row that has the "&" the whole list will look like <BOL>002:</BOL> Jeff & Jane Smith - 67890. It ignores the bold formatting altogether. I think you are right I might have to just replace them, was hoping someone ran into this type a thing before and had a work around. Thanks for the reply.
... View more
08-05-2015
07:45 AM
|
0
|
3
|
1550
|
POST
|
Sorry for the confusion, it is not because I want the symbol, it is just that the symbol is already there in a lot of the attributes that I am trying to write to a text element.
... View more
08-05-2015
07:21 AM
|
0
|
0
|
1550
|
POST
|
So I have a massive amount of data I need to get into a text element, so I wrote a python script for this. textValue += "<BOL>" + row[0] + ": </BOL>" + row[1] + " - " + row[2] + '\r\n'
It works great. 001: John Doe - 12345 002: Jane Smith - 67890 The problem happens when a "&" symbol is introduced. <BOL>001:</BOL> John Doe - 12345 <BOL>002:</BOL> Jeff & Jane Smith - 67890 I get that this is a formatting rule issue, but is there away I can get around this. I guess I could write a script to replace all “&” with “and” but I prefer not to. I appreciate any suggestions.
... View more
08-05-2015
06:49 AM
|
0
|
7
|
4618
|
POST
|
Without seeing the code and error it's hard to say. Are you putting "/" for the rest of the path? If you use "\" you need to add the r at the beginning of the path."Y:/folder1/folder2/folder3/PARAMETER INPUT" or r"Y:\folder1\folder2\folder3\PARAMETER INPUT" . Is your output setting of the parameter a text?
... View more
07-02-2015
12:20 PM
|
0
|
1
|
807
|
POST
|
Perfect! Thank you all, I love this community, I have learned a lot here.
... View more
06-18-2015
11:11 AM
|
0
|
1
|
1237
|
POST
|
Ian/Tom, I have tried the different versions and it still gets written like this: Anna & I want this: Anna Ben Ben Charlie Dora Charlie Dora rows = arcpy.SearchCursor(Layer)
textValue = ""
for row in rows:
count = 1
if (count%2) == 0:
textValue += row.getValue(Value1) + ' '
count += 1
else:
textValue += row.getValue(Value) + '\r\n'
count += 1
ParcelText2.text = textValue
... View more
06-18-2015
10:58 AM
|
0
|
4
|
1237
|
POST
|
I am trying to write my getValues to a text element loop, but I want there to be two results per line before going to the new line. I am having trouble figuring it out? I think I might new a while loop perhaps instead of a for loop, and probably need to use next() somewhere? But that seems to just loop through each name and put one result instead of all four. I don't want this: Anna I want this: Anna Ben Ben Charlie Dora Charlie Dora I don't know what to use in here to achive this. rows = arcpy.SearchCursor(Layer)
textValue = ""
for row in rows:
textValue += row.getValue(Value1) + '\r\n'
ParcelText2.text = textValue
del rows
... View more
06-18-2015
07:22 AM
|
0
|
12
|
4625
|
POST
|
I got it figured out. I think "ALL" might work, but yes the keyword was the issue. I ended up doing sort of a similar thing, I created a new pdf document before the loop, exported each sheet as "CURRENT" then appended the pages to the new pdf. Thanks for the help.
... View more
06-11-2015
04:38 AM
|
1
|
0
|
821
|
POST
|
Got it to work using your suggestions. Had to create a new pdf document before I ran the loop, export each sheet individually, and append. Thanks for the helping me think it through! # Always run script in the mxd you are working on.
mxd = arcpy.mapping.MapDocument("CURRENT")
finalResult = arcpy.mapping.PDFDocumentCreate(r"Y:\GIS\GIS_Work\Working\parcel_test\maps\final.pdf")
# Overwrites any existing features.
arcpy.env.overwriteOutput = True
# Uses the Dataframe called "Layers".
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
extent = df.extent
ParcelText2 = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "ParcelsText2")[0]
ExportSheets = arcpy.mapping.Layer("Sheets_11x17")
Parcels = arcpy.mapping.Layer("Parcels")
ddp = mxd.dataDrivenPages
for pageNumb in range(1, mxd.dataDrivenPages.pageCount + 1):
ddp.currentPageID = pageNumb
SelectedSheet = arcpy.mapping.Layer("Sheets_11x172")
ExportSheetsPage = ddp.pageRow.PLAN_NUMBER
arcpy.SelectLayerByLocation_management(Parcels, "WITHIN", SelectedSheet)
rows = arcpy.SearchCursor(Parcels)
textValue = ""
for row in rows:
textValue += row.getValue("MAP_PARCEL")
ParcelText2.text = textValue
del rows
ddp.exportToPDF(r"Y:\GIS\GIS_Work\Working\parcel_test\maps\test.pdf", "CURRENT")
finalResult.appendPages(r"Y:\GIS\GIS_Work\Working\parcel_test\maps\test.pdf")
del textValue
... View more
06-08-2015
12:19 PM
|
2
|
2
|
1715
|
Title | Kudos | Posted |
---|---|---|
1 | 06-11-2015 04:38 AM | |
4 | 07-25-2014 07:32 AM | |
1 | 11-23-2015 07:18 AM | |
2 | 06-08-2015 11:16 AM | |
2 | 06-08-2015 12:19 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|