|
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
|
333
|
|
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
|
587
|
|
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
|
1251
|
|
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
|
738
|
|
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
|
1100
|
|
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
|
919
|
|
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
|
1100
|
|
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
|
919
|
|
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
|
1490
|
|
POST
|
VBA is on the install CD, it's on the main install screen called "ArcGIS Desktop VBA Resources for Developers". Click on setup and let it install its stuff. THEN you need to license it, to do this you need to contact ESRI to get a free license code which you enter via the desktop administrator. Your organisation may have already obtained these license codes already so worth asking you GIS administrator. Duncan
... View more
06-03-2011
07:56 AM
|
0
|
0
|
485
|
|
POST
|
Mathew, Here is the code you seek, make sure you adjust the myFolder string. Duncan import zipfile, sys, os, glob
# Set the folder that contains the ShapeFiles
myFolder = "C:/Scratch/FWS/"
def zipShapefile(myFolder):
# Check if folder exists
if not (os.path.exists(myFolder)):
print myFolder + ' Does Not Exist!'
return False
# Get a list of shapefiles
ListOfShapeFiles = glob.glob(myFolder + '*.shp')
# Main shapefile loop
for sf in ListOfShapeFiles:
print 'Zipping ' + sf
# Create an output zip file name from shapefile
newZipFN = sf[:-3] + 'zip'
# Check if output zipfile exists, delete it
if (os.path.exists(newZipFN)):
print 'Deleting '+newZipFN
os.remove(newZipFN)
if (os.path.exists(newZipFN)):
print 'Unable to Delete' + newZipFN
return False
# Create zip file object
zipobj = zipfile.ZipFile(newZipFN,'w')
# Cycle through all associated files for shapefile adding them to zip file
for infile in glob.glob( sf.lower().replace(".shp",".*")):
print 'zipping ' + infile + ' into ' + newZipFN
if infile.lower() != newZipFN.lower() :
# Avoid zipping the zip file!
zipobj.write(infile,os.path.basename(infile),zipfile.ZIP_DEFLATED)
# Close zipfile
print 'ShapeFile zipped!'
zipobj.close()
# Got here so everything is OK
return True
# Call function to zip files
b = zipShapefile(myFolder)
if b:
print "Zipping done!"
else:
print "An error occurred during zipping."
... View more
05-25-2011
08:52 AM
|
0
|
0
|
4610
|
|
POST
|
Just a thought but is the feature object you are passing into the function actually a valid object?
... View more
05-24-2011
06:43 AM
|
0
|
0
|
353
|
|
POST
|
Cristian, Use the IFeatureLayer2 Interface it has a property called DataSourceType which returns a string that describes the source type. Duncan
... View more
05-24-2011
06:18 AM
|
0
|
0
|
344
|
|
POST
|
Hello, This is one for the creators of ArcHydro. I have used a component of ArcHydro (the stream burning tool) and wish to reference ArcHydro in my report. What would be the official line on the preferred way of referencing ArcHydro? Duncan
... View more
05-24-2011
03:40 AM
|
0
|
0
|
573
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 4 weeks ago | |
| 1 | 11-21-2025 06:54 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|