|
POST
|
Have you tried arcpy.mapping.UpdateLayer() instead of ApplySymbologyFrom layer? Jeff
... View more
03-20-2012
12:50 PM
|
0
|
0
|
1048
|
|
POST
|
You can't "insert" pictures into a layout. You must first author the MXD with the appropriate number of picture elements and then move them on/off the page based on the particular page. For example:
photo1 = arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT", "photo1")[0]
photo3 = arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT", "photo2")[0]
photo2 = arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT", "photo3")[0]
photo1.elementPositionX = 12 #Off the page
photo2.elementPositionX = 12 #Off the page
photo3.elementPositionX = 12 #Off the page
if page == 1: #Only 1 picture
photo1.sourceImage = somePath
photo1.elementPositionX = 1
photo1.elementPositionY = 5
photo1.elementHeight = 3
photo1.elementWidth = 2
if page == 2: #Two pictures
photo1.sourceImage = somePath
photo1.elementPositionX = 4
photo1.elementPositionY = 6
photo1.elementHeight = 4
photo1.elementWidth = 3
photo2.sourceImage = somePath
photo2.elementPositionX = 4
photo2.elementPositionY = 6
photo2.elementHeight = 4
photo2.elementWidth = 3
etc
When I deal with these dynamic situations I like to store the properties in a table. I read the table and set the value. I hope this is helpful, Jeff
... View more
03-20-2012
12:45 PM
|
0
|
0
|
1713
|
|
POST
|
I'm not sure I completely understand this question. DDP dynamic text is only available if DDP is enabled. If you are using pure arcpy.mapping without DDP then DDP dynamic text won't be available and you have to manually set it through arcpy.mapping. If you provide a more complete scenario and platform (DDP vs arcpy) I'll try to answer this better. Jeff
... View more
03-19-2012
06:49 AM
|
0
|
0
|
2126
|
|
POST
|
If you don't get an answer, I'd suggest you try this post on the geoprocessing forum. You'll have a much better targeted audience. Jeff
... View more
03-14-2012
06:49 AM
|
0
|
0
|
1313
|
|
POST
|
Sorry, I just noticed my code did not come across indented. I accidentally deleted one of the tags. Here it is again:
try:
pdfDoc = arcpy.mapping.PDFDocumentCreate(r"C:\Temp\final.pdf")
for mxds in mxdList:
mapDoc = arcpy.mapping.MapDocument(mxds)
print "Accessed " + mxds
tempFile = r"C:\Temp\temp.pdf"
arcpy.mapping.ExportToPDF(mapDoc, tempFile)
print "Exported to temp PDF"
del mapDoc
pdfDoc.appendPages(tempFile)
pdfDoc.saveAndClose()
except:
print "Did not create pdf"
... View more
03-13-2012
06:37 AM
|
0
|
0
|
1091
|
|
POST
|
Wouldn't this only be the case if you save the MXD? If the objective is to export to PDF, then run the script, export, and don't save changes. This tool may be better off running as a script tool where you can enter an index value and have it just export that page (or a range of pages). It would be a good idea to added match data frame rotation to the ideas.esri.com site. Jeff
... View more
03-13-2012
06:31 AM
|
0
|
0
|
3839
|
|
POST
|
There where 3 issues: 1) the ExportToPDF function takes a MapDocument object as the first parameter, not a path. Therefore I added the mapDoc variable that references the returned MapDocument object. 2) Your tempFile path was bad. It was missing a colon. 3) I created a pdfDoc object outside of your loop and then appended each temporary PDF to it.CODE] The following code try: pdfDoc = arcpy.mapping.PDFDocumentCreate(r"C:\Temp\final.pdf") for mxds in mxdList: mapDoc = arcpy.mapping.MapDocument(mxds) print "Accessed " + mxds tempFile = r"C:\Temp\temp.pdf" arcpy.mapping.ExportToPDF(mapDoc, tempFile) print "Exported to temp PDF" del mapDoc pdfDoc.appendPages(tempFile) pdfDoc.saveAndClose() except: print "Did not create pdf" CODE] Jeff
... View more
03-12-2012
06:32 AM
|
0
|
0
|
1091
|
|
POST
|
Could you please clarify? What isn't working? What does your code look like, etc? Thanks, Jeff
... View more
03-09-2012
05:21 AM
|
0
|
0
|
500
|
|
POST
|
I assume you set the selection symbol via the main selection menu --> selection options. Try setting your selection symbol at the layer level via the ayer properties symbology tab. I just confirmed this and it works. Jeff
... View more
03-07-2012
05:47 AM
|
0
|
0
|
1600
|
|
POST
|
That is odd, it runs fine from IDLE. Have you tried?
arcpy.env.workspace = "c:/data"
Jeff
... View more
03-07-2012
05:32 AM
|
0
|
0
|
3475
|
|
POST
|
At 10.1 we've added AddTableView and RemoveTableView to the arcpy.mapping API. Jeff
... View more
03-06-2012
05:26 AM
|
0
|
0
|
1090
|
|
POST
|
This issue was addressed for SP3 and verified. If you are having an issue, it could be a new one. Please contact Support Services and open an incident. Jeff
... View more
03-06-2012
05:12 AM
|
0
|
0
|
1525
|
|
POST
|
Michael, A few questions: 1) What RDBMS are you going to? 2) Does your new SDE connection have user\password saved with it? 3) Is the connection a user account or an owner account? 4) If you were to manually add the layer from SDE into a map document, would its lyr.datasetName match the name you specified? 5) Do you get different results if you set validate=False Jeff
... View more
03-06-2012
04:59 AM
|
0
|
0
|
659
|
|
POST
|
Try setting your extent twice in a row:
BehaveBoutExtent = lyr.getExtent()
df.extent = BehaveBoutExtent
df.extent = BehaveBoutExtent
We found an issue with 10.0 where in some cases the extent does NOT get set properly based on several conditions. Jeff
... View more
03-05-2012
06:28 AM
|
0
|
0
|
856
|
|
POST
|
I don't think you can do this with Dynamic Text elements. You will need to add your own text element and update its value using arcpy.mapping. Jeff
... View more
03-05-2012
06:23 AM
|
0
|
0
|
2068
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-05-2025 11:20 AM | |
| 3 | 06-05-2025 09:21 AM | |
| 1 | 05-14-2025 01:19 PM | |
| 2 | 04-24-2025 07:54 AM | |
| 1 | 03-15-2025 07:19 PM |
| Online Status |
Offline
|
| Date Last Visited |
06-23-2026
10:29 AM
|