|
POST
|
Tim, I don't program in c# so when I looked at your code I noticed something that I would not do. So this could be a red herring and may be what you are doing is simply slicker than how I program? Anyway the line that I thought unusual was: while ((feature = cursor.NextFeature()) != null) I don't know if this is a preference thing but I would have done (in VB): pFeature = pCursor.NextFeature do while not pFeature is nothing counter = counter +1 pFeature = pCursor.NextFeature loop So the retrieving of the feature that you are testing is done in the loop and not on the line that is evaluating if it is nothing. Duncan
... View more
10-26-2011
06:26 AM
|
0
|
0
|
1075
|
|
POST
|
Tony, Exporting the model to a script does show the field mapping parameter. But I agree it's not clear how you would construct that string in a programmatic way. Looking at the Help file it talks about a fieldmappings object being a collection of fieldmap objects but nothing seems to show that long string that the tool builds. Maybe a simpler alternative is to use a Make FeatureLayer tool to turn on/off fields and then the Copy Features tool? Duncan
... View more
10-19-2011
01:16 AM
|
0
|
0
|
1010
|
|
POST
|
Tony, A very simple way to work out how to set up your field map is: Start Arcmap and load your table and layer In Arcmap join your table to your layer Start a new blank model Drop a FeatureClassToFeatureClass tool on your model Open this tool and complete it setting all the options (this includes your field mapping) Export the model to a Python script from the Model > Export menu option Open that script and discover the syntax of the tool which is using your data! Duncan
... View more
10-18-2011
07:56 AM
|
0
|
0
|
1010
|
|
POST
|
I think you need to reset the second feature cursor with each loop of your first feature cursor. You code should look like: Dim pFCursor As IFeatureCursor
Set pFCursor = pFeatureClass.Search(Nothing, True)
Dim pFCursor2 As IFeatureCursor
Dim pFeature As IFeature
Dim pFeature2 As IFeature
Dim pPointA As IPoint
Dim pPointB As IPoint
Set pFeature = pFCursor.NextFeature
Do Until pFeature Is Nothing
Set pPointA = pFeature.Shape
MsgBox pFeature.Value(intPosFID) & "F1"
Set pFCursor2 = pFeatureClass.Search(Nothing, True)
Set pFeature2 = pFCursor2.NextFeature
Do Until pFeature2 Is Nothing
Set pPointB = pFeature2.Shape
MsgBox pFeature2.Value(intPosFID) & "F2"
Set pFeature2 = pFCursor2.NextFeature
Loop
Set pFeature = pFCursor.NextFeature
Loop Duncan p.s. Please place your code samples inside the code tags (the # symbol on the toolbar)
... View more
10-18-2011
01:52 AM
|
0
|
0
|
526
|
|
POST
|
Josh, In 9.3 the sequence would be to listen out for the onCreateFeature event in the IEditorEvents Interface. This gives you a handle on the the feature you just drew and through this you can gain access to the attributes of the feature which you update. If you are using Domains on fields then you'll want to access and read those values into your combobox on your form, check out the IDomain Interface. If you are using 10 it maybe different as Templates now exist, not sure how they complicate things. Duncan
... View more
10-18-2011
01:34 AM
|
0
|
0
|
527
|
|
POST
|
Josh What you are asking is fairly easy, you could even knock up a form quickly in VBA. But you should consider something else if stream lining data entry (and thus quality) is your prime concern, you should be using Domains. One thing that will improve your data entry is to have your dataset as a FeatureClass in a GeoDatabase. You can then set domains on the beetle and release fields. You cannot do this for Shapefiles. This would control exactly what goes into those fields. Little drop downs appear on the Table in those fields. Duncan
... View more
10-17-2011
05:56 AM
|
0
|
0
|
527
|
|
POST
|
All, I can't find the interface that allows me to change the default geodatabase of an existing MXD, does it even exist? I found this thread but the Interface seems to be related to changing the default geodatabase at the Application level not an existing MXD. Our network structure forces us to have a roaming profile with my documents there. This has serious detrimental affects on the performance of ArcMap and any geo-processing tools (very slow) but we found out that by setting the MXD's default database to one on the C:\ drive the tools speed up significantly. So I was looking for a way to batch process the update of this map document property but I am unable to find are hook into it! Any ideas? Duncan
... View more
10-17-2011
05:39 AM
|
0
|
0
|
978
|
|
POST
|
Tony, The problem is your FeatureClassToFeatureClass tool. In your code you create a string called expression. First thing to note is that this line is wrong expression = "ACCOUNT", "OwnerName", "Address", "City" , "State", "ZipCode" it is creating a list object. I am assuming your intention is to limit the fields to the final dataset to these? This would be the field mapping parameter not the where clause parameter. expression = "ACCOUNT,Ownername,Address" would create a single string. Secondly the parameter order of FeatureClassToFeatureClass is incorrect. If you read the help on this tool it is where clause then field mapping. As you want to limit the fields you need to specify the where clause which I assume is nothing so a simple "" should suffice. So before you do anything fire up help and study the parameter order and their specifications to get the code working. Duncan
... View more
10-17-2011
03:07 AM
|
0
|
0
|
1010
|
|
POST
|
James, It would help us to help you if you post up your model. Duncan
... View more
10-17-2011
02:49 AM
|
0
|
0
|
808
|
|
POST
|
Frank, I don't program in Java, may be others do but I think it would help if you post up your code so the Java gurus can have a look at it? Duncan
... View more
10-17-2011
02:39 AM
|
0
|
0
|
264
|
|
POST
|
It looks like you are almost there. All you need to do is create the attribute fields you wish to populate in your output dataset. You do this by using the AddField tool and do that after you have called the createfeatureclass tool. You already have the code to extract data from your input file so you simply extract your attributes and write these to your new output row which you are calling feat. If you can't work out how to do that then upload a sample of your input file so people can see what fields you are wanting to pass to your output dataset. Duncan
... View more
10-10-2011
07:31 AM
|
0
|
0
|
613
|
|
POST
|
Have you tried contacting the Author of this script, they would have the best chance in correcting the error? You can contact them from the Arcscript page.
... View more
10-10-2011
07:23 AM
|
0
|
0
|
3746
|
|
POST
|
Search help for "RemoveLayer" it's a method in the arcpy mapping module.
... View more
10-10-2011
07:12 AM
|
0
|
0
|
644
|
|
POST
|
Alex, Below is some VBA code that I think achieves what you are asking. Interestingly it does not seem to adjust the setting in the dataframe > Properties > General > Units(display) drop down. Duncan Public Sub test()
Dim pMXDoc As IMxDocument
Set pMXDoc = ThisDocument
Dim pLatLonFormat As ILatLonFormat2
Set pLatLonFormat = New LatLonFormat
With pLatLonFormat
.ShowDirections = True
.ShowZeroMinutes = True
.ShowZeroSeconds = True
End With
Dim pReportUnitFormat2 As IReportUnitFormat2
Set pReportUnitFormat2 = pMXDoc
pReportUnitFormat2.CoordinateReadoutUnits = esriDecimalDegrees
Set pReportUnitFormat2.CoordinateReadoutLatLonFormat = pLatLonFormat
End Sub
... View more
10-10-2011
02:41 AM
|
0
|
0
|
419
|
|
IDEA
|
-->
I would like to see a simple addition to the context menu in the Table of Contents. If you click on the little button List by Source in the TOC you see your layers organised by their source location. Some of my layers use Domains on fields to control the entry of data. Domains are stored at the GeoDatabase level. The only way to view these are to go the GeoDatabase in the Catalog window and enter the properties window of the GeoDatabase. You cannot get to this properties window from the TOC when in List by Source mode. So I would like to see a new option when one right clicks on the geodatabase in the TOC (when in List by Source mode) to open location in the Catalog Window at which point I can drill down into the properties and edit my Domain. At the moment I have to manually open Catalog and navigate to the appropriate location where the GeoDatabase is and most of my MXD's are linking to multipe GeoDatabases across multiple drives.
... View more
10-03-2011
07:12 AM
|
9
|
4
|
1203
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | a month ago | |
| 1 | a month ago | |
| 1 | a month ago | |
| 1 | 11-21-2025 06:54 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|