|
POST
|
Cory, See amended code and my notes. Duncan # Import system modules
import sys, string, os, arcpy
# Create the Geoprocessor object
# NOTE: DO NOT USE CREATEOBJECT METHOD
ary = arcpy.Array()
pnt = arcpy.Point()
## create rect starting lower right going clockwise
# NOTE: THE x & y PROPERTY ARE IN CAPITALS
pnt.X = -117.0
pnt.Y = 35
ary.add(pnt)
pnt.X = -117.0
pnt.Y = 35.75
ary.add(pnt)
pnt.X = -116.25
pnt.Y = 35.75
ary.add(pnt)
pnt.X = -116.25
pnt.Y = 35
ary.add(pnt)
## redo first point (lower right)
pnt.X = -117.0
pnt.Y = 35
ary.add(pnt)
## -------------------------------------------------------------
AOI = "C:\\Temp\\test9.shp"
ScratchWS = "C:\\Temp"
# Process: Create AOI Feature Class...
arcpy.CreateFeatureclass_management(ScratchWS, "test9", "POLYGON", "", "DISABLED", "DISABLED", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision", "", "0", "0", "0")
cur = arcpy.InsertCursor(AOI)
feat = cur.newRow()
feat.shape = ary
cur.insertRow(feat)
... View more
06-23-2011
01:16 AM
|
0
|
0
|
450
|
|
POST
|
Dan, Thanks for checking this one. After much poking around in ArcCatalog I found how to make ArcMap aware of ASC files, as always it was a small checkbox in an out of the way part of options that I had to tick. This seems to affect all of ArcMap and the GeoProcessing tools so I can now at least see the file! 😉 So lets start with the obvious, %n% starts at zero, is your first asc file sample0.asc? Duncan
... View more
06-16-2011
12:35 PM
|
0
|
0
|
1922
|
|
POST
|
Dan, I do not have 9.3.1 I have 9.3. Can you confirm as it would be interesting to know that just running the Make XY Event Layer by itself (so not in a model) that you can actually navigate to a file with the file extension .asc? I can't do this, it does not show, but you can? ESRI must have been doing some tweaking behind the scenes if this is the case? Duncan
... View more
06-16-2011
07:30 AM
|
0
|
0
|
1922
|
|
POST
|
Marcus, This may be a red herring, but here is an old thread talking about the error but for an older version of ArcView. http://forums.esri.com/thread.asp?c=3&f=38&t=45124 Duncan
... View more
06-15-2011
08:04 AM
|
0
|
0
|
467
|
|
POST
|
Logan, Looking at your model you are using an iterate feature, this produces a single feature or row from you input FeatureClass and this is feeding into a Dissolve tool. Dissolving a single row does not make sense as typically you dissolve many geometries into each other based upon a field. I think the model logic is flawed? It would make sense if you were iterating through a folder of featureclasses, if this is the case then you want to be using the Iterate FeatureClass. Duncan
... View more
06-15-2011
07:43 AM
|
0
|
0
|
641
|
|
POST
|
Nancy, People may be able to help you if you zip up your model and upload it? But if you don't want to do that try setting the models environment workspace property? Duncan
... View more
06-15-2011
07:31 AM
|
0
|
0
|
490
|
|
POST
|
Jeremy, Probably the easiest way is to reclassify your source raster dataset to create one big raster dataset of one value then covert that into the polygon? Duncan
... View more
06-15-2011
07:27 AM
|
0
|
0
|
864
|
|
POST
|
Dan, Why your model is failing (and I don't think it is to do with the %n%) is that the Make XY Event tool does not take asc files as input. For example sample1.asc won't work but sample1.txt will! I think it's a simple matter of changing the file extension. This is assuming your text files are comma separated and the first row is the header so something like: ID,X,Y,Z 1,10,10,-9999 2,20,23,-9999 3,11,33,12.5 Duncan
... View more
06-15-2011
07:06 AM
|
0
|
0
|
1922
|
|
POST
|
Keith, Without seeing the code it's a bit hard to answer. Is the envelope you are doing the clip with getting refreshed? Do you set any spatial analyst properties using the IRasterAnalysisEnvironment interface, if so are they getting refreshed? I know you are developing in VB .Net but in a VB6 project of mine if a COM error occurred which I had not trapped for it would always blitz the whole tool bar and one would need to close and restart ArcMap. I was wondering if you could test for the scenario and stop it ever causing the error? Duncan
... View more
06-14-2011
07:22 AM
|
0
|
0
|
986
|
|
POST
|
So you have no consistent naming convention in the facilities field? I think Alexander's advice would help you. Create a new field that codes the type of facility this would simplify your query.
... View more
06-08-2011
03:01 AM
|
0
|
0
|
1651
|
|
POST
|
You can change map scale like this: Dim pMap As IMap
Dim pmxDoc As IMxDocument
Set pmxDoc = ThisDocument
Set pMap = pmxDoc.FocusMap
pMap.MapScale = 10000 This VBA example assumes your data frame has its coordinate system set. Duncan
... View more
06-07-2011
05:41 AM
|
0
|
0
|
1175
|
|
POST
|
Hello, First of all can I correct your English. "Wanna" is not an English word, you should be saying "I want to create a query..." not "I wanna create a query...". OK English lesson over. In your Shapefile example does the facilities field always end with "-->School" or have you put that in as an explanation? If it does then you want to create a QueryFilter to return a cursor for all rows that end with that text sequence. You can find a simple example of how to create a cursor in the VBA developers Help under the sample section, the page is called "Perform an attribute query". The WhereClause string can be determined easily by doing the query in ArcMap so you get the syntax correct, it should be something like: "FACILITIES" LIKE '%-->School'
... View more
06-07-2011
03:12 AM
|
0
|
0
|
1651
|
|
POST
|
dgesri, What you are asking does not make sense. If you want to zoom to a selection then to zoom to the extent of that selection must alter the scale. Below is the VBA code that you could use to call the zoom to selection tool. Public Sub ZoomToAllSelectedFeatures()
' Zoom to selection by calling standard tool
Dim pCmdItem As ICommandItem
Dim pUID As New UID
pUID.Value = "{AB073B49-DE5E-11D1-AA80-00C04FA37860}"
Set pCmdItem = ThisDocument.CommandBars.Find(pUID)
pCmdItem.Execute
End Sub Duncan
... View more
06-07-2011
02:52 AM
|
0
|
0
|
1175
|
|
POST
|
This is good news, I program only in VB so looking forward to using the new File GeoDatabase API through VB .Net. Duncan
... View more
06-07-2011
02:39 AM
|
0
|
0
|
2255
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | a month ago | |
| 1 | a month ago | |
| 8 | 03-30-2026 10:12 AM | |
| 2 | 03-18-2026 08:16 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|