|
POST
|
Chris, I note you specified version 9.3. You can program your task either in VBA or Python. If you wanted to write in Python (you might want to to this if you intend to use the code in newer versions of ArcGIS) then forget about the command line console and get yourself pyscripter, its free and really good. In your example you have 10 * 100 combinations which through brute force is probably quite quick. But if your real datasets have thousands of points then you'll have millions of combinations. I guess the smarter way to do it is use a select by location tool with a maximum distance so you are only ever processing a subset. You could run the entire script outside arcgis in pyscripter or wire it all up to a script tool interface and expose your code as geo-processing tool in arctoolbox. Duncan
... View more
03-23-2013
10:17 AM
|
0
|
0
|
1051
|
|
POST
|
Bruce, Just thinking out aloud here. So on the second run of the code the intersect tool does not report any error and it does not create the in_memory dataset? Are the layers changing, or are they the same layers but with a different selection on them? Also does one of the layers have the calcacres field? Duncan
... View more
03-23-2013
09:31 AM
|
0
|
0
|
712
|
|
POST
|
All, FYI I resolved the problem, it appears to be with the way I was deleting the dBase file. Originally I was deleting the table using the following code: My.Computer.FileSystem.DeleteFile(sFullPath) I changed this to the more verbose method using ArcObjects: Dim pWorkspaceFactory As IWorkspaceFactory pWorkspaceFactory = New ShapefileWorkspaceFactoryClass Dim pFeatureWorkspace As IFeatureWorkspace pFeatureWorkspace = pWorkspaceFactory.OpenFromFile(sPath, 0) pTable = pFeatureWorkspace.OpenTable(Me.TextBox1.Text) Dim pDataset As IDataset pDataset = DirectCast(pTable, IDataset) If pDataset.CanDelete Then ' Delete and clean up pDataset.Delete() pTable = Nothing pTable = Nothing pFeatureWorkspace = Nothing pWorkspaceFactory = Nothing End If This has resolved my problem.
... View more
03-15-2013
08:45 AM
|
0
|
0
|
607
|
|
POST
|
Just an idea but you could just call the Identity GeoProcessing Tool? This does assume you and your users have Arc/Info (Advanced) license level.
... View more
03-14-2013
09:48 AM
|
0
|
0
|
1086
|
|
POST
|
All, I have developed an AddIn for ArcMap 10.1 using VB .net 2010. My tool writes data it creates to a dBase file which gets loaded into the TOC. During processing the tool can create up to 25 fields. Sometimes a user will need to rebuild this table with its initial set of 3 fields (by selecting a button on toolbar). When the user clicks on the create table button my code searches for the table in the TOC and removes it with the following code: pStandAloneTableCollection.RemoveStandaloneTable(pStandAloneTable) pMXDocument.UpdateContents() The code then continues by deleting the existing dBase file and then recreates with the default set of 3 fields. This all works fine. The table is loaded back into the TOC with the following code: pStandAloneTable = New StandaloneTableClass pStandAloneTable.Table = pTable pStandAloneTable.Name = Me.TextBox1.Text pStandAloneTableCollection.AddStandaloneTable(pStandAloneTable) pMXDocument.UpdateContents() If I then go to the Table in ArcMap and open it I see all the previous fields (with zero values) and not an attribute table with just 3 fields. It's as if ArcMap has held onto the schema of the table it had removed, any ideas on how to force a refresh? Duncan
... View more
03-14-2013
09:37 AM
|
0
|
1
|
1207
|
|
POST
|
Hi, I zoomed into a map and set the extent to the current display and then ran the VBA script below to see what came out
Public Sub x()
Dim p As IGeoProcessor
Set p = New GeoProcessor
Dim x As String
Let x = p.GetEnvironmentValue("extent")
Debug.Print x
End Sub
The result is a string with numbers separated by a single SPACE character and not commas. Also the values are anti-clockwise starting with "LEFT BOTTOM RIGHT TOP". Nothing I can find in the ArcObjects API help indicates this what so ever! The only place I have found any indication in what order the limits of your extent should be is here in Python. Duncan
... View more
02-28-2013
06:59 AM
|
0
|
0
|
1188
|