|
POST
|
Abby, Ok I just thought may be the missing units could be a potential issue, but it does not sound like it. I understand your explanation but I disagree. Whilst Arcmap reports the total number of features selected in the statusbar your code is working at the layer level. Your code selects a single well based upon the DataSetPrimkey and this selection is used to do a within distance selection on the layer "AFOLyr". So for argument sakes it selects 100 features in the AFOLyr layer. Yes Arcmap will display a selection of 101 in the statusbar but you have 1 well selected and 100 AFOLyr features. Your get count code is counting the number of selected features in the AFOLyr layer so get count will return a value of 100. Your code then clears the selection on each layer. The NEW_Selection clears the selection on the AFOLyr layer as that is what you are selecting on, this does not clear the single selected well point. So why I keep banging on about the selection type is that your discrepancies (which is something to be concerned about) may be due to existing selections on your dataset which you are unintentionally adding to. Humour me, make it a NEW selection and see what your results are, the worse case is that they still have discrepancies which indicates something else is at fault? Duncan
... View more
05-10-2012
01:10 AM
|
0
|
0
|
2010
|
|
POST
|
Abby, Don't know if this will help but if you add a selectbylocation tool to model builder fill it in and export it to Python one sees how the tool parameters should be completed. For selectbylocation the distance also includes its units as shown below: arcpy.SelectLayerByLocation_management("layer1","WITHIN_A_DISTANCE", "layer2","100 Meters", "ADD_TO_SELECTION") Still don't get your logic to why you are adding to a selection, for this line you are adding to the selection of "AFOLyr" # Select ancillary layer within 10km...
arcpy.SelectLayerByLocation_management("AFOLyr",SelDist,"Wells2Lyr",10000,SelAddTo) which you then clear with this line: arcpy.SelectLayerByAttribute_management("AFOLyr",SelClear) Duncan
... View more
05-09-2012
06:55 AM
|
0
|
0
|
3566
|
|
POST
|
Abby, I must emphasise Chris's comment about placing your code in the code tags (#) as this makes reading your code easier. This is even more important with Python as indentation is everything! Look at your code you posted how are we to tell when code is outside a loop? Anyway... I have two ideas: Is the code where you clear existing selections outside the For loop? Can't tell as there is no formating... In your selection code arcpy.SelectLayerByLocation_management("AFOLyr",SelDist,"Wells2Lyr",10000,SelAddTo) you are doing a selection and adding it the existing selection. Was that your intention? Are you not trying to do a new selection for each iteration of the cursor? If so replace SelAddTo with SelNew. DUncan
... View more
05-09-2012
12:54 AM
|
0
|
0
|
3566
|
|
POST
|
Are you using the correct name for the model? For this line of code to be correct you need to be using the name not the label of your model. Set pGPTool = pGPToolBox.OpenTool("xxx") In toolbox right click on your model and go to properties. You should be using the model NAME not the LABEL. Duncan
... View more
05-07-2012
07:15 AM
|
0
|
0
|
4755
|
|
POST
|
You need to replace my variable string g_ToolBoxPath with the folder where the tool box is. For example "C:\XYZ\ModelTools"
... View more
05-06-2012
05:11 PM
|
0
|
0
|
4755
|
|
POST
|
Claire, You add a 2 new fields, one for Z and one for M. Then you run the calculate field tool with a simple bit of python that extracts the Z or M value from the point geometry. Look at this page about reading properties of points in python. Duncan
... View more
05-06-2012
05:07 PM
|
0
|
0
|
974
|
|
POST
|
This is going to be painful... EndIf should be (note space) End If Duncan
... View more
05-04-2012
08:58 AM
|
0
|
0
|
6288
|
|
POST
|
Can you post up the script, exactly how you entered it?
... View more
05-04-2012
08:45 AM
|
0
|
0
|
6288
|
|
POST
|
Mohammed, Below is some VBA I used to execute a custom model in a toolbox, this should get you going. Duncan ' Create workspacefactory Dim pToolboxWorkspaceFactory As IWorkspaceFactory Set pToolboxWorkspaceFactory = New esriGeoprocessing.ToolboxWorkspaceFactory 'Open a toolbox workspace Dim pToolboxWorkspace As IToolboxWorkspace Set pToolboxWorkspace = pToolboxWorkspaceFactory.OpenFromFile(g_ToolBoxPath, 0) ' Connect to tool Dim pGPToolBox As IGPToolbox Set pGPToolBox = pToolboxWorkspace.OpenToolbox("WFD49e Processing Tools Enhanced.tbx") Dim pGPTool As IGPTool Set pGPTool = pGPToolBox.OpenTool("mdSubSetFloodplain") ' Run tool Dim pGPToolCommandHelper As IGPToolCommandHelper Set pGPToolCommandHelper = New GPToolCommandHelper pGPToolCommandHelper.SetTool pGPTool pGPToolCommandHelper.Invoke Nothing ' Destroy objects Set pToolboxWorkspaceFactory = Nothing Set pToolboxWorkspace = Nothing Set pGPToolBox = Nothing Set pGPTool = Nothing Set pGPToolCommandHelper = Nothing
... View more
05-04-2012
08:28 AM
|
0
|
0
|
4755
|
|
POST
|
Claire, You should always state what version of ArcGIS you are using if you want us to help you as this dictates what can or cannot be done. If you have ArcInfo then have a look at this tool Feature Vertices To Point in the Data Management toolbox. You could then add M and Z fields and populate using a simple calculate script extract the ZM values. Duncan
... View more
05-04-2012
08:20 AM
|
0
|
0
|
974
|
|
POST
|
Abby, Are your datasets in different coordinate systems (projections)? This may account for the difference. I think some tools perform best when the data is NOT in decimal degrees. Duncan
... View more
05-04-2012
08:10 AM
|
0
|
0
|
3566
|
|
POST
|
Michelle, If you've copied your script correctly then you are missing a bracket at the end of your line. arcpy.CalculateField_management ("FA_Urbans","POPSQMI", "!SQMI!/!FID_1!","PYTHON")
... View more
05-04-2012
08:00 AM
|
0
|
0
|
1129
|
|
POST
|
I think you need to add at the top of your code a simple dim statement like: Dim x Also not sure this line is correct: ElseIf [CLASSIFICATION_1] = "<null>" you may want to try something like (I did not test these): ElseIf [CLASSIFICATION_1] = "" or ElseIf IsNull([CLASSIFICATION_1]) = True Duncan
... View more
05-04-2012
07:41 AM
|
0
|
0
|
6288
|
|
POST
|
Pam, This is just a guess but you mention that the Access database has "numerous forms and reports". This suggests to me that this database is not actually a GeoDatabase? I would image that the zonal stats tool is expecting a GeoDatabase to write to and hence your problems. You should create a GeoDatabase and run the zonal stats tool and send output there to test this? You could then link those tables into your other database? Duncan
... View more
05-02-2012
01:57 AM
|
0
|
0
|
1074
|
|
POST
|
Lorna, FYI I've got ArcGIS 10 and was able to add the DLL to ArcMap without any error and then drag the button onto a toolbar although I did not use it. This would indicate that it's a permission issue for you and you need to get IT "support" to help you. Duncan
... View more
05-02-2012
01:31 AM
|
0
|
0
|
1187
|
| 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 |
07-07-2026
10:17 AM
|