|
POST
|
Additional Information: The following knowledge base article describes the procedure HowTo: Convert an annotation feature class to a shapefile But the following error is displayed.
Executing (Calculate Field (2)): CalculateField "\\hcgis1\gis\Arc\Projects\WTH\Work_Area\Work Data.gdb\Work_Anno" Longitude Output VB "Dim Output As Double
Dim pArea As IArea
Set pArea = [Shape]
Output = pArea.Centroid.X"
Start Time: Wed Dec 28 09:08:27 2011
General error executing calculator.
ERROR 999999: Error executing function.
Expected end of statement
Failed to execute (Calculate Field (2)).
Failed at Wed Dec 28 09:08:30 2011 (Elapsed Time: 3.00 seconds)
The same error displays when attempting the calculation; (1) directly on the field (i.e. Field Calculator) in an edit session, and (2) With the "Calculate Field" tool in my model - FYI the model "used" to work at 9.3.1. Thanks in advance. You cannot do geometry calculations with VB Script at ArcGIS 10. VBA is no longer available in the field calculator and shape variables are not supported in VB Script. (VBA and VB Script are similar, but have key differences that prevent you from doing geometry calculations with VB Script at ArcGIS 10). You have to convert to Python to do geometry calculations in the field calculator. Because you are using Centroid you cannot access the coordinate with the FirstPoint option. For Area based objects you probably need to use Centroid (at least for something odd like Annotation, it might work with a true Polygon, which has a starting point). !Shape.Centroid.X! See the field calculator help here for more on geometry calculation in ArcGIS 10. Also the Python syntax was incorrect in the post above. The exclamations points go around the Shape qualifiers as shown above. So !Shape.FirstPoint.X! might also work, but it would not return the same result as your original VBA calculation, since that is returning the Centroid.
... View more
12-28-2011
05:44 AM
|
0
|
0
|
2510
|
|
POST
|
With ArcGIS 10 (not sure about earlier versions) Linear Referencing Routes that have XYZM values will interpolate Z at any point along the line. The Create Route tool should preserve the Z values of the original points and add M values based on the 2D length of the line. If you want to adjust the M values to account for elevation changes (3D Length) along the line check out my tool in the Gallery. You can either use the Locate Features Along Route tool or if the points are evenly spaced along the line in 2D or 3D intervals generate your own Event table manually (pretty easy to do in Excel). However, Route branching my cause an issue with the Event table approach. Anyway, I hope this helps.
... View more
12-26-2011
06:39 AM
|
0
|
0
|
9648
|
|
POST
|
Do a spatial join with parcels as the target feature and overlay districts as the join feature. Join one to many using the "intersects" option. That will give you one row for each combination of parcel and overlay district. Then you can do some sort of pivot table to get them to show up as columns. I believe this would work with overlapping polygons... For the Pivot Table operation you can use the Pivot Table tool if you have an ArcInfo license. If you don't, see my last post in this thread for an Excel table that uses an Excel pivot table and formulas to do the Pivot of actual table values from rows to columns.
... View more
12-23-2011
08:00 AM
|
0
|
0
|
2861
|
|
POST
|
It depends if the second field contains Null values or whitespace characters or a mixture of the two. Assuming it is a mixture (and that the first field does not also need to be tested for blank or Null) try: Dim Output
If IsNull([MyField2]) Then
Output = [MyField1]
Elseif Trim([MyField2]) = "" Then
Output = [MyField1]
Else
Output = [MyField1] & "-" & [MyField2]
End If If you plan on exporting to a Python script than this needs to be rewritten in Python to work. However, this post suggests that Python cannot test for Null values in the field calculator like VB Script can and that you should use a cursor instead for that condition.
... View more
12-21-2011
05:40 AM
|
0
|
0
|
1115
|
|
POST
|
I want to replicate something that I can do within ArcMap and model builder. I have a categorical raster with an attribute table consisting of 10 fields "Rowid", "Value", and "Count". I would like to use the SelectLayerByAttribute_Management tool using arcpy. My code so far is: # Import arcpy module import arcpy # define the location of raster titled rstName Rst = "C:/..../rstName" # Select Rowid = 0 arcpy.SelectLayerByAttribute_management(Rst, "NEW_SELECTION", "\"Rowid\" = 0") The error msg I get is: * File "C:\...\abc.py", line 16, in <module> *** arcpy.SelectLayerByAttribute_management(Rst, "NEW_SELECTION", "\"Rowid\" = 0") * File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 4259, in SelectLayerByAttribute *** raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Table View. ERROR 000825: The value is not a layer or table view ERROR 000840: The value is not a Mosaic Layer. Failed to execute (SelectLayerByAttribute). ------------------------- Can some help me troubleshoot this issue? SelectLayerByAttribute_management cannot take a raster directly as an input. You need to create a layer for the raster using CreateLayer_Managment (I believe) and then use that as an input to the SelectLayerByAttribute_management tool.
... View more
12-20-2011
08:47 AM
|
0
|
0
|
2215
|
|
POST
|
Hello, I have created a simple model to copy a feature dataset from one geodatabase to another. I want to feature dataset to overwrite an existing feature dataset. There are no locks on any data in either geodatabases. When I try to run the model I get Error 000260, which results in the feature dataset in the paste location to be deleted. However, when I manually run the Copy tool, I can copy the feature dataset without issue. Not sure why this is not working. Any help is appreciated. Thanks, Chris Could you screen shot your model? The order of operations and properly setting up preconditions related to the deletion is important. Also did you run Validate on the Model?
... View more
12-20-2011
06:06 AM
|
0
|
0
|
879
|
|
POST
|
Hello im a beginner of Arcgisand i have following problem I have a shapefile where i need to some calculations. In the shapefile there are attributes (Area in m², Irradiance in W/m² and temperature in °C�?�) and I have to do a multiplication. I can do It manual by adding a new field and type in the expression : Power=Area*Irradiance. But I need to do this for a lot of entrys and so I want to make a process in the model builder. How can I extract the data in the attribute table to do the calculations and add a field at the end of the attribute table with the calculated power? thanks for your help in advance flo The Add Field operation can be done with the Add Field tool under the Fields section of the Data Management toolset group. This tool only needs to be used once for a given field on a given feature class/table. If the data source is being recreated without the field each time you need to run the script than it can be part of the script that calculates the field. Otherwise, it needs to be done in its own script and only run if the field has been dropped. The rest of the script is simply to first use the Make Feature Layer tool under the Layers and Tableviews section of the Data Management group and the Field Calculator tool under the Fields section of the Data Management group to perform the calculation. If you only want to calculate a selected set of records, you can use the Select By Attribute tool under the Layers and Tableviews section of the Data Management group between those two tools.
... View more
12-20-2011
05:18 AM
|
0
|
0
|
900
|
|
POST
|
Richard, I have downloaded your tool and tried to use it, but clicking on the button interface of the tool, greyed out the tool and did not bring up an iterface window. I am using ArcGIS10 SP3. Thanks, Narmina You must enable the extension in the Customize | Extension Manager. The behavior is expected if the extension is disabled. The readme file lists the set up steps in more detail as well as the expected tool behaviors and limitations. Let me know if there is still a problem after the extension is enabled.
... View more
12-16-2011
01:18 PM
|
0
|
0
|
2887
|
|
POST
|
Hi all: I have a dataset that contains multiple facilities, misc data, and their x,y coordinates in UTM. I have added new records and modified some existing records in the shapefile's attribute table. However, these new/modified records do not display once I stop and save the edit session. Also, I have a subset of the dataset described above, created via selection by attribute and exported into a new shapefile that does not update either when I recreate the new shapefile after modifying the attribute table. Any idea what I'm doing wrong here? Thanks Your description of what you are doing and the effect is not entirely clear. What version of ArcGIS are you using? Are you working with an XY Event layer or a point layer in the first part of your problem? Are you creating new records by inserting a point or just adding a record in the attribute table? The first method is required for a point class and the second works with an XY Event table. Do the edits revert back to what was there before you edited or do the features and records simply disappear? Do you have any definition queries in place? For the second part about exporting I would just assume that if the first behavior is resolved that the second will follow suit. Either way, a little more description of your feature class, layer settings (especially any definition query), work flow and a more specific example of an edit and what shows up after you save the edits would help.
... View more
12-16-2011
08:23 AM
|
0
|
0
|
667
|
|
POST
|
any ideas on getting this run in the field calculator? It won't work with the Field Calculator. The Field Calculator will not let you control the record order by sorting it, which this code needs to do.
... View more
12-09-2011
07:25 AM
|
0
|
0
|
3482
|
|
POST
|
Richard: Do you know the syntax to calculate area in Square Miles? Thanks in advance for your time... Mark !SHAPE.AREA@SQUAREMILES! Here is the help topic I am consulting on the topic: Using the Calculate Field tool
... View more
12-06-2011
06:30 AM
|
0
|
0
|
4751
|