POST
|
I'm trying to add a title to an exported pdf. The output should look similar to the attached file (ignore the 'Clip -- Tile 232') Instead of the 'Planar' title (which I supplied manually), however, I'd like to be able to supply the title from my pythonaddins (ArcGIS 10.1) code. The 'Planar' title resides on a TextElement that I added in Layout view. As shown, this title resides on its own data frame. The relevant code is as follows: def createPDF(self): # Method to obtain truncDateString datestamp # self.mxdClipLayer is the mxd of interest getDateTime() pdfString = 'Clip_' + truncDateString[9:15] for elm in arcpy.mapping.ListLayoutElements(self.mxdClipLayer, "TEXT_ELEMENT"): print elm. #??? arcpy.mapping.ExportToPDF(self.mxdClipLayer, envPath + "pdf/" + pdfString + ".pdf") The problem lies with the print statement. I'm trying to print elm.name or elm.text, but the Intellisense doesn't provide any property associated with elm. Furthermore, the program fails when I try to force the issue by including 'text' or 'name' as the property. Thanks in advance for any help you can provide.
... View more
12-02-2013
08:07 AM
|
0
|
0
|
531
|
POST
|
Try this: with arcpy.da.SearchCursor(InputFC, field) as cursor: for row in cursor: if (row[0] == 1): I have problems integrating a python script in a modelbuilder tool. I'm a absolute beginner with python, any help is much appreciated. Maybe there's also an easier way to solve this problem in modelbuilder, but I haven't found it yet so here's my problem: my modelbuilder tool's flow of control needs to evaluate a situation and decide on one of two courses of action: If the value in the field "Building" in my feature class is 1, it should follow one path, if the value is greater than one it should follow another path. Here's my python code that I tried so far # Load the arcpy module
import sys, os, arcpy
# Get the input feature class from the model
InputFC = arcpy.GetParameterAsText(0)
field = "Building"
cursor = arcpy.SearchCursor(InputFC)
# check if one or more than one building footprint exist
for row in cursor:
Building =(row.getValue(field))
if Building == 1:
arcpy.SetParameterAsText(1, "True")
arcpy.SetParameterAsText(1, "False")
else:
arcpy.SetParameterAsText(1, "False")
arcpy.SetParameterAsText(2, "True") regards nicolas
... View more
06-09-2013
05:26 PM
|
0
|
0
|
278
|
POST
|
The following code worked fine for weeks, but now suddenly causes my ArcMap program to crash. The list zoningValues is supposed to contain a distinct, ordered list of zone codes. The source of the codes is the field "ZO_ZONE" from an SDE feature class (zoningFClass). In the while loop, zoningValues is first populated with the unsorted, non-distinct zoning codes. The if statement contains the LINQ query to order and make distinct the list. This part still works fine. The final line is supposed to populate a combo box with the list values. However, this line either makes my program crash, or starts a seemingly endless loop of constantly referring back to the query. In the latter case, it's as if sortedList is a constructor object that needs to redefine itself each time. private List<string> zoningValues = new List<string>(300); internal void PopZoningList(IFeatureClass zoningFClass) { //Populate the Zoning values list IFeatureCursor searchCursor = zoningFClass.Search(null, true); int fieldNdx = searchCursor.FindField("ZO_ZONE"); IFeature feature = null; //Loop through the Zoning feature class and populate a list with each ZO_ZONE value while ((feature = searchCursor.NextFeature()) != null) { zoningValues.Add(feature.get_Value(fieldNdx).ToString()); feature = null; } //When the features are exhausted, sort the values and make them unique, then add them to the Zoning combo box if (feature == null && zoningValues.Count >= 2) { //sZones is an arbitrary variable name var sortedList = (from sZones in zoningValues select sZones) .Distinct().OrderBy(n => n); cboZone.DataSource = sortedList;[/SIZE] Thanks in advance for looking into this. Charlie Shore
... View more
10-26-2012
12:17 PM
|
0
|
0
|
179
|
POST
|
I'm creating a VS2010 (C#) AddIn, and receiving the error "Cannot register assembly "---.dll. Could not load file or assembly '----' or one of its dependencies. The system cannot find the file specified." Well, the dll is there, so I have no idea what this is referring to. I'd like to try to turn off auto-registration for COM components in the project settings, as suggested in the previous post. However, again, there are no details on how to do this. I realize that the project properties has a Settings property, but I can't find any documentation on how to use it. Is that where I can set the auto-registration to false?
... View more
09-27-2012
06:40 AM
|
0
|
0
|
947
|
POST
|
I have begun to work with the Election Polling Place app, which includes the ParcelPublicAccess.mxd. The mxd includes a FacilitySitesPoint layer, which has over 200 coded values representing various facility types. Several of these facility types are shown in the World Topographic Map service. Is there any way to capture these facilities from the Topographic Map, for use in the Polling Place app, without going back to the raw data? Thanks in advance.
... View more
06-15-2012
02:30 PM
|
0
|
0
|
466
|
POST
|
I got the same HRESULT error (0x8004152f) when using the following code: It starts with this statement: string strQuery = "PL_PMAP == '" + txtTile.Text + "'"; which is then passed in as one of the parameters in the following statement: clsQuery.QueryPoly("Match Sheet", strQuery, txtTile.Text, featureSelection, 2); and here is the recipient class: class clsQuery { private static IQueryFilter queryFilter = new QueryFilterClass(); public static void QueryPoly(string dataFrame, string query, string tileNum, IFeatureSelection featureSelection, Int32 index) { queryFilter.WhereClause = query; featureSelection.SelectFeatures(queryFilter, esriSelectionResultEnum.esriSelectionResultNew, true); The query is "PL_PMAP = '555'". Everything about these statements look right -- the correct feature class is selected; it contains a string field called PL_PMAP; and, '555' is an actual value in that field. I don't understand your statement about looking in the interface (IFeatureSelection?) to discover the cause of this error. The limited amount of additional information about the error is also vague, although I suspect a permissions issue (???) Thanks in advance for any light you can throw on this.
... View more
09-26-2011
03:09 PM
|
0
|
0
|
314
|
POST
|
"Studio 3 simplified greatly the concept of adding JavaScript content assist." Typical ESRI -- by 'simplify' they mean making things 5 times more difficult, and basically unusable!
... View more
08-13-2011
08:01 AM
|
0
|
0
|
655
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|