|
POST
|
Hi, I tried this code (note I do not set a workspace) and it copied the featuredataset and the featureclasses within it without error.
import arcpy
i = r'C:\Scratch\fGDB_Scratch.gdb\test'
o = r'C:\Scratch\fGDB_AIS_Cleaned.gdb\test'
arcpy.Copy_management(i,o,"FeatureDataset")
Duncan
... View more
02-21-2012
12:07 AM
|
0
|
0
|
802
|
|
POST
|
Just an idea but have you tried to link to the database using ArcCatalog? This will at least prove that you can connect to it (so not some weird permission issue) and you'll be able to see the properties of the connection so you can ensure you have a correct connection string? Well thats what I would do first...
... View more
02-20-2012
06:43 AM
|
0
|
0
|
1111
|
|
POST
|
You can do this in one of 2 ways, create a geoprocessor object and call the spatial analyst CON tool. If you want to stay within the arcobject environment then you need to be using the IConditionalOp Interface and do a conditional operation (if nodata set to zero else use existing cell value). Duncan
... View more
02-20-2012
06:21 AM
|
0
|
0
|
582
|
|
POST
|
Mustafa, Are you using ESRI software? If so why not simply use the geoprocessor and call the Project tool? If you don't want or can't use ESRI software then you could try to use something like OGR in GDAL which is open source? Duncan
... View more
02-10-2012
08:14 AM
|
0
|
0
|
624
|
|
POST
|
Halil, Looking at your sample code I believe the sample you have found is specific to MS Access. If you want to open a website using VBA in ArcMap 9.3 use this code instead: Dim iE As Object Set iE = CreateObject("InternetExplorer.Application") iE.navigate "www.rivex.co.uk" iE.Visible = True Duncan
... View more
02-10-2012
08:06 AM
|
0
|
0
|
824
|
|
POST
|
To future proof your tool and as you know vba I would start using vb. Net. You will need visual studio 2010. In version 10 they have introduced addins which are much easier to distribute.
... View more
02-02-2012
09:47 AM
|
0
|
0
|
1352
|
|
POST
|
Mesut, I am having similar problems getting old 9.3 VBA projects up and running in 10. I too was getting unexplained compile problems on seemingly innocent lines of code. This is what I did: Save a copy as a version 10 mxd and work from that go into vba editor menu > references and untick all esri references. recompile vba project and save. In 9.3 recompiling would have caused arcmap to say don't know IMap etc and one would add back the appropriate object library but in 10 it seemed to know and add them back, may happen for you? recompile and if it objects to a line go to it. I found for example it did not like my reference to IStatusbar so I had to re-write the line to include the library so I was retyping dim pSB as esriSystem.IStatusbar. Recompile and correct any other lines. So no code needed altering other than declaration lines. All very odd! Duncan
... View more
02-02-2012
05:37 AM
|
0
|
0
|
1352
|
|
POST
|
Gavin, I must apologies I had made a mistake. I can replicate your issue such that you get 2 AXF files not one when one layer is checked out and the other is a read only layer. So I can't back track fast enough! 😮 Yeah looks like you cannot achieve what you were looking for just 1 AXF file. But in my experience the more you jam into it the less stable it becomes and the device crashes more often. I do what you are planning to, I have a layer checked out that I'm populating and everything else is read only shapefiles. Duncan
... View more
02-01-2012
12:02 AM
|
0
|
0
|
1279
|
|
POST
|
All, I have developed some code that uses the IGeoProcessor object. It was bombing out when I was adding a Toolbox with an incorrect path. I realised my mistake and decided to add a bit of error trapping by using the Exist method to check if the toolbox exists before trying to add it to the GeoProcessor. So my code looks like this: Dim pGP As IGeoProcessor2
pGP = New GeoProcessor
If pGP.Exists("C:\temp\test.tbx", "Toolbox") Then
pGP.AddToolbox("C:\temp\test.tbx")
End If In the help it says: Test the existence of a given parameter value (GPValue or catalog path) the type of the data is optional. So my catalog path is obviously C:\temp\test.tbx but my data type is not optional I have to put something there. I tried Nothing and even a string that contains nothing or any text I like. So the line of code below is accepted and runs without error returning true (as the toolbox exists). pGP.Exists("C:\temp\test.tbx", "Duncan is ace") So what do all the developers have to say about this? What should I put there for the non-optional parameter? I could just put Nothing or maybe I should put something sensible, but the Help gives NO help about what possible value I should put there, it says it should be a variant that represents pDataType. There is an interface call IGPDataType but as I can put anything there I find myself wondering what should really go there? Duncan
... View more
01-31-2012
07:12 AM
|
0
|
0
|
2024
|
|
POST
|
Gavin, In ArcPad 10 when in ArcMap I can use the Get Data for ArcPad wizard to check out data from different geodatabases into a single axf database and one layer can be editable the other read only. The read only never appears in the editable layers menu on ArcPad. You would set one layer as Action > Export as background data (to AXF layer) > Make read only and for the editable layer you code do Action > check out for disconnected editing > check out schema only. So yes you can have editable and read only in a single axf file. Duncan
... View more
01-31-2012
05:35 AM
|
0
|
0
|
1279
|
|
POST
|
Gavin, If you have layers that are only ever going to be read only maybe you should export those to Shapefile for better performance. AXF may be the all singing and dancing solution to most storage solutions but I have found them to be a bit flaky sometimes, especially when one has more than 4 layers in an AXF (well that's my experience anyway). Check this page out about ArcPad and Shapefiles. Duncan
... View more
01-30-2012
06:42 AM
|
0
|
0
|
1279
|
|
POST
|
Enrico, I think the short answer is no to both of your questions. Duncan
... View more
01-30-2012
05:44 AM
|
0
|
0
|
1209
|
|
POST
|
Demetris, I've restructured your code. Have a look. You should really get into the habit of documenting your code with comments, this is good programing as it allows others to follow the code easier. Duncan Dim pBlockBoundaryFC As IFeatureClass
Set pBlockBoundaryFC = pBlockBoundary.FeatureClass
Dim pBlockBoundaryFields As IFields
Set pBlockBoundaryFields = pBlockBoundaryFC.Fields
' Create Spatialfilter
Dim pGeom As IGeometry
Dim pSpatialFilter As ISpatialFilter
Set pSpatialFilter = New SpatialFilter
' Create a cursor over all BlockBoundary
Dim pBlockBoundaryCursor As IFeatureCursor
Set pBlockBoundaryCursor = pBlockBoundaryFC.Search(Nothing, False)
' Main BlockBoundary loop
Set pBlockBoundaryFeature = pBlockBoundaryCursor.NextFeature
Do Until pBlockBoundaryFeature Is Nothing
' Get block boundary polygon and update spatialfilter
Set pGeom = pBlockBoundaryFeature.Shape
With pSpatialFilter
Set .Geometry = pGeom
.GeometryField = "Shape"
.SpatialRel = esriSpatialRelTouches
End With
' I am assuming you have a NewParcelFC layer
set pNewParcelsCursor = pNewParcelFC.Search(pspatialfilter,False)
Set pNewParcelsFeature = pNewParcelsCursor.NextFeature
Do Until pNewParcelsFeature Is Nothing
FID = pNewParcelsFeature.Value(intposFID)
MsgBox FID
Set pNewParcelsFeature = pNewParcelsCursor.NextFeature
loop
' Get next Block boundary
Set pBlockBoundaryFeature = pBlockBoundaryCursor.NextFeature
Loop
... View more
01-30-2012
01:50 AM
|
0
|
0
|
898
|
|
POST
|
Diss, I created a VB AddIN and in the onclick event I put this code together and got it working. It looks like the input layer has to be a featurelayer object and not a string. Duncan ' Get handle input point layer
Dim pmap As IMap
pmap = My.ArcMap.Document.FocusMap
Dim pLayer As ILayer
pLayer = pmap.Layer(0)
Dim pFeatureLayer As IFeatureLayer
pFeatureLayer = pLayer
' Run geoprocessing tool
Try
' Create Minimum bounding geometry tool
Dim mbg = New ESRI.ArcGIS.DataManagementTools.MinimumBoundingGeometry()
With mbg
.geometry_type = "convex_hull"
.in_features = pFeatureLayer
.out_feature_class = "c:\temp\conhull.shp"
End With
' Cast as a GPProcess
Dim pGPProcess As ESRI.ArcGIS.Geoprocessor.IGPProcess
pGPProcess = mbg
' Create GeoProcessor
Dim GP As New ESRI.ArcGIS.Geoprocessor.Geoprocessor
GP.OverwriteOutput = True
GP.AddOutputsToMap = True
' Execute tool
Dim pResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
pResult = GP.Execute(pGPProcess, Nothing)
Catch ex As Exception
MsgBox(ex.Message)
End Try
MsgBox("finished!")
... View more
01-16-2012
01:08 AM
|
0
|
0
|
1139
|
|
POST
|
Could try the tool feature vertices to points? http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Feature_Vertices_To_Points/00170000003p000000/
... View more
01-15-2012
08:46 AM
|
0
|
0
|
1710
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-03-2026 07:31 AM | |
| 3 | 06-29-2026 05:17 AM | |
| 1 | 02-15-2023 05:45 AM | |
| 1 | 06-16-2026 02:37 AM | |
| 1 | 06-15-2026 08:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|