|
POST
|
updating a text element in an mxd is not working for me ArcGIS 10 - 10.1.2800 there is a text string element in the mxd "SHEET 3002" that i want to change based on a variable this was tested on an mxd that only has this text element in it and nothing else this is the code to change the text element it that is not working: import arcpy
import arcpy.mapping
MXD = arcpy.mapping.MapDocument("CURRENT")
for SheetNum in arcpy.mapping.ListLayoutElements(MXD, "TEXT_ELEMENT", "SHEET*"):
SheetNum.text = "SHEET 7001" if the code is: import arcpy
import arcpy.mapping
MXD = arcpy.mapping.MapDocument("CURRENT")
for SheetNum in arcpy.mapping.ListLayoutElements(MXD, "TEXT_ELEMENT", "SHEET*"):
if SheetNum.type == "TEXT_ELEMENT":
SheetNum.text = "SHEET 7001" still nothing happens if i try: SheetNum = arcpy.mapping.ListLayoutElements(MXD, "TEXT_ELEMENT", "SHEET*")[0] it returns: Runtime error <type 'exceptions.IndexError'>: list index out of range what is wrong with this?
... View more
03-31-2011
05:57 AM
|
0
|
5
|
1335
|
|
POST
|
Another way is to save this as a python script and add it to your toolbox then put it in your model with the output of the select by location as a precondition #### Created By: Frank #### Created on: 03/22/2011 #### Description: Zooms to a selected elements in a layer of an MXd ## Set the necessary product code import arcinfo # If you do not have an ArcInfo license change this ## Import arcpy module and environment module import arcpy import arcpy.mapping ## Sets the MXD file, if run out of ArcMap set the full path to the MXD file ex: "C:\Workspace\Parcel_Map.mxd" MXD = arcpy.mapping.MapDocument("CURRENT") ## Set Data Frame for the layer to select from to the data frame the selected element is in DF = arcpy.mapping.ListDataFrames(MXD, "Layers")[0] #If the data frame name is not Layers change this ## Pan to selected features DF.zoomToSelectedFeatures() ## Refresh data farame arcpy.RefreshActiveView
... View more
03-22-2011
10:22 AM
|
0
|
0
|
743
|
|
POST
|
Hi, Under geoprocessing environments you will find an option tocheck/uncheck "maintain fully qualified field names" or something to that degree. This will allow you to perform joins/remove joins without having to let ArcGIS/ModelBuilder find the fully qualified field name (e.g. fieldname not tablename.fieldname) Thank you, even though that is unchecked, the results in the model show the Table.Field name. In the pictures attached you can see that the table exported from the model has the simple fieldnames but objects in the model do not. With the results in the model having the full qualified path other tools can not be run from them, like Make XY Layer, and if the resulting tables are used, like in the example, other processes will not work from them. The spatial join I am trying to accomplish does not get the fields from the join on the result in the model, the features output have to used in order for it to work. This is very clunky and frustrating.
... View more
03-09-2011
08:56 AM
|
0
|
0
|
4500
|
|
POST
|
I too am frustrated with Model Builder in 10 (Build 2800). I consistently get an error that my join table is already joined. The troublesome part is that I don't know how to "unjoin" it, and feel I shouldn't have to within a model as that's inefficient (to say nothing of bad logic.) Between that and the fact that after you rebuild a join, you have to re-truncate your output fields from jointable1.Field1 to Field1, jointtable.Field2 to Field2. (examples) for every field, I am incredibly disappointed with the way it works now. This used to work in 9.3.1. you can add a remove join to the model on your join out put with the result of what uou use the join for as a precondition, see attached 'm hoping to find a way not to have the output set to table.field in the exported tables but haven't found it yey, if you find it please post
... View more
03-08-2011
05:52 AM
|
0
|
0
|
4501
|
|
POST
|
after you georeference the cad file in arcmap and update the georeferencing from the georeference toolbar you should be pompted to create a world file (.wld) in the same directory and with the same name as your cad dataset, once that is created your data should be in the right place spatially when you convert the cad to geodatabse you have to make sure you mxd sessionis using the coordinate system as the dataset you are going to use in the geodatabase; if you want the output geodatabase features created from the cad to be the same as your other database features make sure the mxd coordinate system is set up correctly
... View more
03-07-2011
03:29 AM
|
0
|
0
|
1532
|
|
POST
|
the create xy event layer tool will work with csv files that are comma delimitted but if you still want to convert them to tabs you can use a program named textpad that can be downloaded for free from the web
... View more
03-03-2011
11:03 AM
|
0
|
0
|
678
|
|
POST
|
Heya, 😄 I�??m currently trying to convert CAD annotations to Points (shp), the points need to be from the centre of the annotation as there representing depths. However the method of using the samples tool, > CAD to feature class places the points to the left of the annotation, (When you enter select feature class type as annotation). When you put point in this field nothing happens and no data even converts. Though it does seem like this should work? Does anyone know how to use this tool to get a point in the middle of the annotations? seems like such a simple task, however pulling my hair out trying to do so! :confused: Thanks Guys Any help is much appreciated. Lola Aberdeen, Scotland if you use the CAD to Geodatabase tool to convert the CAD then use the Data Management>Features>Feature To Point tool to convert the anno to points it should put it in the center
... View more
02-18-2011
09:23 AM
|
0
|
0
|
640
|
|
POST
|
Hello, I am working on the same problem. did you by chance resolve this? if so, could you post your solution?...thanks for your time. --Daniel not yet but there is a clunky work around that can be done with model builder if your polygon starts at 0,0 xy create a point from the polygon, add xy attributes, and two new fields x1, y1, calculate 1x and y1 to the values of point_x or point_y + values for the x,y of the location to move to create points from the vertices of the polygon and do the same steps then create xy event layers of the centroid point and vertices and create points from that then create lines from the vertices points using the points to line python script esri provided THEN create a polygon from the lines and moved centroid point very clunky and it only works if your polygon starts at 0,0 xy if anyone knows a better way please post it up
... View more
02-10-2011
08:29 AM
|
0
|
0
|
714
|
|
POST
|
YES dealing with that here too, what also works, but waste time, is to remove the link to the join, run the model to create a new table, validate, then re-link the join to the output waste of time Make sure to add a remove join to the output after calculating fields if you do not want the other tables fields in the final output is any one else experiencing the out puts resulting in added fields like 1, 12, 12 13, 12 13 14 after testing models ?
... View more
02-10-2011
03:50 AM
|
0
|
0
|
4501
|
|
POST
|
is there a python equivalent to the ITransform2D.Move method? i am trying to move a polygon from one place to another based on a known XY coordinate something like: !Shape.centroid.x! = new_coordx !Shape.centroid.x! = new_coordy move
... View more
02-03-2011
04:06 AM
|
0
|
6
|
1469
|
|
POST
|
Frank, Have you looked at the help recently? ESRI are forcing people to go the way of Python and have made changes to how VB scripting functions. You need to make some minor changes to you script and they are documented here. Basically drop your Dim statements. Duncan i've tried six ways to sunday to get this to work by dropping various dim statements and it won't run in 10 guess it will have to be converted to python
... View more
02-02-2011
05:56 AM
|
0
|
0
|
411
|
|
POST
|
I'd like to create a ModelBuilder model that I can point to a directory and have the model merge all the annotation from every single DWG file that is within that directory. I can do this if I manually select each DWG file and the annotation layer within each CAD file, but I don't want to have to manually select each input dataset, but rather just point to the directory and let the model iterate automatically. Ideas? Jay Johnson Reno, NV you may have to create an empty anno feateature class first then in the model use the Iterate Datasets tool to select each dwg and convert it to geodatabase features then select the anno using the new Select Data model tool and append it to the anno feature class you created Iterate Dataset doc: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Iterate_Datasets/00400000000q000000/ Something like this
... View more
02-02-2011
05:50 AM
|
0
|
0
|
555
|
|
POST
|
awhile ago Dean Thevaos posted this tool that would move polygons to a known xy location so long there was an XY field in the polygon attribute table with the x coord and y coord seperated by a comma it worked in 9.3.1 and no longer works in arcgis 10, anyone know why? Dim pPolygon As IPolygon Dim pArea As IArea Dim pOrigin As IPoint Dim sXYField As String Dim dXY() As String Dim dX As Double Dim dY As Double Dim pTransform As ITransform2D sXYField = [XY] If (Not IsNull([Shape])) Then Set pPolygon = [Shape] dXY = Split(sXYField, ",") dX = CDbl(dXY(0)) dY = CDbl(dXY(1)) If (Not pPolygon.IsEmpty) Then Set pArea = pPolygon Set pOrigin = pArea.Centroid Set pTransform = pPolygon dX = dX - pOrigin.X dY = dY - pOrigin.Y pTransform.Move dX, dY End If End If __esri_field_calculator_splitter__ pPolygon
... View more
01-31-2011
10:48 AM
|
0
|
2
|
983
|
|
POST
|
make sure that you have set the geoprocessing options to overwrite existing outputs "Overwriting tool output The Overwrite the outputs of geoprocessing operations check box controls whether tools automatically overwrite any existing output when run. When it is checked, you receive a warning before tool execution that the output exists, but the tool executes and overwrites the output dataset. With this option off, existing outputs are not overwritten, and the tool displays an error, preventing you from executing the tool."
... View more
01-25-2011
09:59 AM
|
0
|
0
|
1765
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-14-2016 11:31 AM | |
| 1 | 01-22-2016 10:12 AM | |
| 1 | 08-17-2011 12:28 PM | |
| 16 | 09-04-2015 08:57 AM | |
| 1 | 01-18-2011 09:42 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|