POST
|
First let me say I am not versed in python....with that being said I have tried many sample codes of python and have not had any luck. I am trying to create roughly 127,000 cover pages. I want the pdf name to come from our PARCELNO field, for example 0101010000001000.pdf. We are having no luck. Is there not a simple way to have python choose the parcel number from the PARCELNO field and export that to a pdf? I apologize in advance if this a simplistic question. >>> mxd = arcpy.mapping.MapDocument("CURRENT") ... for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): ... mxd.dataDrivenPages.currentPageID = pageNum ... arcpy.mapping.ExportToPDF(mxd, r"C:\Users\bpg\Desktop\\" + str(pageNum) + ".pdf") ... del mxd So the code exports but as 1.pdf, 2.pdf and so on. In the Set Up Data Driven Pages window I have choose PARCELNO as my Page Number from the drop down. I feel like we are close any suggestions. Update Below is the script that correctly exported our pdf files. >>> ... import arcpy ... mxd = arcpy.mapping.MapDocument("CURRENT") ... ddp = mxd.dataDrivenPages ... for pageNum in range(1, ddp.pageCount + 1): ... mxd = arcpy.mapping.MapDocument("CURRENT") ... ddp = mxd.dataDrivenPages ... ddp.currentPageID = pageNum ... arcpy.mapping.ExportToPDF(mxd, r"U:\Bart\test\\" + ddp.pageRow.getValue(ddp.pageNameField.name) + ".pdf") ... del mxd Just posting this in case anyone else needs the same script.
... View more
03-13-2015
06:51 AM
|
0
|
0
|
3442
|
POST
|
Still not labeling parcels with null lot number attributes. I have attached a screen capture.
... View more
10-02-2013
10:28 AM
|
0
|
0
|
989
|
POST
|
First off, thank you for all your help. I am not even a novice at Python, so I don't think I stated my initial question very well. I want to label the parcels that are lots one way and the metes & bounds parcels another way. I want to label the parcels that are lots, the lot field is not null, as parcel stacked on top of lot number. I want to label the parcels that are not lots, the lot field is null, as parcel stacked on top of deeded acreage. I tried both your solutions and still the parcels that are not lots are not getting labelled at all. My PARCEL and LOTNUMBER fields are text fields. DEEDACRES is a double field. I apologize for any confusion.
... View more
10-02-2013
10:02 AM
|
0
|
0
|
989
|
POST
|
I am trying to create one label expression that has two label options. The first option will stack the parcel number on top of the lot number and the other option would stack the parcel number on top of deeded acreage. The [LOTNUMBER] field, [PARCEL] field, are text fields the [DEEDACRES] is a double. I have no python experience, did not think this expression would be this difficult to come up with. I would appreciate any help. def FindLabel ( [PARCEL] , [LOTNUMBER] , [DEEDACRES] 😞 if long([LOTNUMBER]) >1: return "<CLR yellow='255'>" + [PARCEL] + "</CLR>" + '\n' + [LOTNUMBER] else: return "<CLR yellow='255'>" + [PARCEL] + "</CLR>" + '\n' + [DEEDACRES]
... View more
10-01-2013
12:36 PM
|
1
|
15
|
6418
|
Title | Kudos | Posted |
---|---|---|
1 | 10-01-2013 12:36 PM |
Online Status |
Offline
|
Date Last Visited |
04-13-2023
10:27 AM
|