|
POST
|
I can't figure out how to do this in the UI and I'm certain you can't do it with Python using rectangle text elements. Height and position values involve the rectangle, not the text. BUT ... You could author 2 objects: a text element and a rectangle element. Set both of their anchor positions to be lower left. You also need to set the vertical and horizontal positioning to be bottom and left, respectively. To do this, go to properties of text element, select text tab -->change symbol --> edit symbol. Make sure the text now aligns nicely with the lower left corner of the rectangle. Pull the text information from a field, evaluate the height of the text and set the heigth of the rectangle element accordingly. For example.
mxd = arcpy.mapping.MapDocument("current")
lyr = arcpy.mapping.ListLayers(mxd)[0]
rect = arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT", "rect")[0]
txt = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "txt")[0]
cur = arcpy.SearchCursor(lyr)
row = cur.next()
txt.text = row.getValue("filedName")
rect.elementHeight = txt.elementHeight + 0.1
arcpy.RefreshActiveView()
Why do it in the UI, when you can do it with ArcPy. Jeff
... View more
11-04-2011
06:58 AM
|
0
|
0
|
1138
|
|
POST
|
I've tried both mxd.findAndReplaceWorkspacePaths, and mxd.replaceWorkspaces and they are both working (using 10.0 SP3). I've set up my environment to mimic yours (I think). TEST1: I have a fGDB FC and a SQL Table (with an ole db connection). The MXD contains both the FC and table as well as a join from the FC to the table. I copied the same table to a different SQL Server DB and created a second connection file. I calculated some of the fields to have different values so I could determine if the join was pointing to the correct table. The functions just worked. TEST2: Next I tried deleting the orignal table. Thinking that you have broken sources and perhaps broken sources are the problem. In this scenario, when I reopen my MXD, my table is broken and the join on the FC no longer exists. I thought this would be the cause but the tests still run like they did above. Jeff
... View more
11-03-2011
06:19 AM
|
0
|
0
|
3151
|
|
POST
|
Not unless it is an attribute of a feature. Check out the following help link: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005s00000027000000.htm Jeff
... View more
11-02-2011
06:18 AM
|
0
|
0
|
662
|
|
POST
|
Would you be able to provide me with a map package so I can try to reproduce the issue? Send to [email protected]. Thanks, Jeff
... View more
11-02-2011
06:09 AM
|
0
|
0
|
508
|
|
POST
|
Not currently at 10.0. At 10.1 we've introduced a new arcpy.mapping ExportReport function. Here is a snippet from the 10.1 help: Summary Exports a formatted, tabular report using data from layers or stand-alone tables in a map document along with the report template information that is provided in a report layout file (.rlf). Discussion The ExportReport function provides a mechanism to automate the generation of reports that are originally authored in a map document (.mxd) using the reporting tools available in ArcMap. A report layout file authored in ArcMap is a template that stores information about the content and placement of the items in a report. The report layout file is used along with the source data in a map document to create output reports. The source data can also have associated joins and related table information that is used within the report. Jeff
... View more
11-02-2011
06:02 AM
|
1
|
0
|
1716
|
|
POST
|
I just ran into this exact issue today. My table name and alias name were different. I had a table join in place so when I tried to search using the alias name, it failed. When I used the full table name, it worked. For example, fieldValue = row.getValue("FieldName") - this failed with the error you note. fieldValue = row.getValue("TableName.FieldName") - this worked Jeff
... View more
11-01-2011
02:13 PM
|
1
|
0
|
1632
|
|
POST
|
In my first response to this thread, I said I marked this as a bug and submitted it to our developer and it is hopefully something we can address in time for SP4. You can track it with NIM074823. Jeff
... View more
11-01-2011
07:24 AM
|
0
|
0
|
1783
|
|
POST
|
I wonder if it is data specific. What type of value are you trying to get? Is the value null, a blank string, etc? I notice in one case you use "WP_NO" and in your second example you use pageRow.index. Are you on 10.0 SP3? I just tried: fieldValue = mxd.dataDrivenPages.pageRow.State_Name fieldValue = mxd.dataDrivenPages.pageRow.getValue("State_Name") and they both worked. If you could send me a map package of your data, I'd be happy to look into it further. Send to [email protected]. Thanks, Jeff
... View more
11-01-2011
06:47 AM
|
1
|
0
|
1632
|
|
POST
|
Some service layers (e.g., WMS) have built in limitations on the server side. The server won't serve an image too large in size. A work around is to reduce the DPI (resolution). Your ExportToJPEG could be working because its default DPI is 96 whereas the default DPI for PDF is 300. I hope this helps, Jeff
... View more
10-31-2011
06:39 AM
|
0
|
0
|
1208
|
|
POST
|
Is there a way you could use scale thresholds or are the two groups scale independent? I can't think of a way to do it in the UI. You would need to build a custom event handler. Jeff
... View more
10-26-2011
06:12 AM
|
0
|
0
|
3863
|
|
POST
|
Do you want to do this with Python/geoprocessing or ArcObjects. If you want to do it with Python/gp then simply create a script tool with a single parameter (parcel number). You can run the script tool from a toolbox or you can add a script tool to a custom toolbar. Jeff
... View more
10-25-2011
07:40 AM
|
0
|
0
|
878
|
|
POST
|
Can you please provide me with a map package so I can test your scenario? Remove layers from the MXD that are not necessary. Then go to File --> CreateMap Package. Send it to [email protected] Thanks, Jeff
... View more
10-25-2011
07:37 AM
|
0
|
0
|
2563
|
|
POST
|
Your first issue is very similar to the WMS layer and its sub layers. For example, your TOC has the following layers:
World_Imagery
World Imagery
Low-Resolution (15m) Imagery
High-Resolution (60cm) Imagery
High-Resolution (30cm) Imagery
The root layer "World_Imagery" is an AGS Map service and it does support "SERVICEPROPERTIES". The problem is that you are bypassing it with the "if" lyr.isGroupLayer statement. After that you are using "elif" statements so you never test to see if it ALSO supports service properties, you only test the sub layers which do not. I know this is tricky. The service layer is a group layer AND a a service layer type= MapServer. Again this can be done with the lyr.longName property. Concerning your second issue and determining specific data types. What gets reported from the describe statement does NOT match what you see in the UI when you go into the layers data source properties. The UI lists one value but the arcpy.describe lists a different value. I think the two should be the same and it should match the UI. For example: UI, Data Type = CAD Annotation Feature Class Describe.dataType = FeatureLayer UI, Feature Type = Simple Describe.featureType = CoverageAnnotation. This needs to be looked at. I currently don't have a way to CAD data unless the "CAD" is in the layer name. Thanks, Jeff
... View more
10-25-2011
07:27 AM
|
0
|
0
|
1783
|
|
POST
|
Thanks for posting this to the ideas page. We'll take this into consideration for our next release. Note it is too late for the 10.1 timeframe. Jeff
... View more
10-24-2011
12:34 PM
|
0
|
0
|
1888
|
|
POST
|
I just confirmed this on a 10.0 SP3 machine. Image Server layers no longer show up as layers that support the lyr.support("DATASOURCE") property. Before attempting to change a data source, check to see if this property is true. for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.supports("DATASOURCE"): If you are still having a problem, please send me a map package so I can test with your data. Thanks, Jeff
... View more
10-24-2011
10:59 AM
|
0
|
0
|
2983
|
| 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 |
a month ago
|