|
POST
|
Michael, I've personally turned my back on COM extensibility in favour of AddIns as as you say there is no nightmare installation issues. Simply drop the AddIn in a folder and point ArcMap to the folder, hey presto its installed. Even a non-power user can do that. The only issue I have come across within AddIns is that when porting say an older 2005 VS project you have to rebuild the whole toolbar from scratch. A bit of a pain but acceptible. Duncan
... View more
01-23-2013
06:20 AM
|
0
|
0
|
1027
|
|
POST
|
You need to upload your code if you want anyone to even have a chance at answer this!
... View more
01-23-2013
06:09 AM
|
0
|
0
|
1199
|
|
POST
|
Coding gurus, I've got a question about best practise when using the ComReleaser object. In the first example below is some stub code showing how I would typically using ComReleaser when I'm processing within a single loop. Using comRel As New ComReleaser() pFeatureCursor = pFeatureClass.Update(pQueryFilter, False) comRel.ManageLifetime(pFeatureCursor) pFeature = pFeatureCursor.NextFeature Do While Not pFeature Is Nothing ' Do something pFeatureCursor.UpdateFeature(pFeature) pFeature = pFeatureCursor.NextFeature Loop pFeatureCursor.Flush() End Using Now suppose I want to loop through another cursor whilst looping through the first cursor, so nested. Is it appropriate to have a Using statement within a using statement (1) or do you simply add the inner cursor to the comReleaser object (2). I ask as I've not seen any examples and was wondering what was the best approach when nesting cursors? Example 1 Using comRel As New ComReleaser() pFeatureCursor = pFeatureClass.Update(pQueryFilter, False) comRel.ManageLifetime(pFeatureCursor) pFeature = pFeatureCursor.NextFeature Do While Not pFeature Is Nothing ' Do something Using comRel2 as New ComReleaser() pFeatureCursor2 = pFeatureClass2.Search(pQueryFilter2, False) comRel2.ManageLifetime(pFeatureCursor2) ' Do something inner looping stuff End Using pFeatureCursor.UpdateFeature(pFeature) pFeature = pFeatureCursor.NextFeature Loop pFeatureCursor.Flush() End Using Example 2 Using comRel As New ComReleaser() pFeatureCursor = pFeatureClass.Update(pQueryFilter, False) comRel.ManageLifetime(pFeatureCursor) pFeature = pFeatureCursor.NextFeature Do While Not pFeature Is Nothing ' Do something pFeatureCursor2 = pFeatureClass2.Search(pQueryFilter2, False) comRel.ManageLifetime(pFeatureCursor2) ' Do something inner looping stuff End Using pFeatureCursor.UpdateFeature(pFeature) pFeature = pFeatureCursor.NextFeature Loop pFeatureCursor.Flush() End Using In example 2 pFeatureCursor2 is added to comRel on every cycle of the outer cursor loop, is that good, bad or irrelevant?
... View more
01-23-2013
06:05 AM
|
0
|
15
|
8861
|
|
POST
|
You may need to check that the other machine has missing references? In vb editor go to menu > references and check for italic missing references and untick them.
... View more
12-16-2012
12:22 PM
|
0
|
0
|
904
|
|
POST
|
Bert, OK found the source of the difference. Go to ArcCatalog and work out the vertical extent distance (Extent top - extent bottom). This gives you a value of 10194.24176. Divide that by your Y length cell size and you get 10037. The code method you are using is assuming that you X and Y size are the same, but they are not in your case, thus if you divide the vertical extent difference by X length size you get 55996. So it suggests that the code method assumes X and Y are the same length for a cell which is the normal case. Duncan
... View more
11-29-2012
05:13 AM
|
0
|
0
|
1863
|
|
POST
|
Bert, Not having the original dataset to interrogate makes it difficult to answer why the code version reports a different row count. I note that that the screen shot from ArcCatalog shows the cell size to be not symmetrical. This could be the source of the error? Maybe the algorithm behind the code version computes the row count based upon cell size and extent of dataset? This is the only thing I can think of. You can test this with a dataset that has a more typically symmetrical cell size. Create a raster using the Create Raster Dataset tool so you know you are creating a grid that conforms to the esri standard and compare the different row count techniques. Duncan
... View more
11-28-2012
11:58 PM
|
0
|
0
|
1863
|
|
POST
|
Bert, Not tried it but I guess your rlyr object is a RasterLayer object? If so this interface actually has a row count method called...wait for it... RowCount! Duncan
... View more
11-28-2012
01:30 PM
|
0
|
0
|
1863
|
|
POST
|
Here is one for the developer gurus... I'm using ArcMap 10.1 and developingi in visual studio 2010 VB .net. I create a form, drop a button on it, drop a tooltip control on it and under the properties of the tooltip control I can set the properties ToolTipIcon to Info and ToolTipTitle which gives me a nice professional looking tooltip to aid my users. Now for an ESRI AddIn button I can set the tooltip text in the Config.esriaddinx file as shown below: <Button id="GDI_btnPointAnalysis" class="btnPointAnalysis" message="Point Analysis Tools." caption="Point Analysis Tools" tip="Point Analysis Tools" category="Tools" image="Icons\AnalysisDS.bmp" onDemand="false"/> Is there anyway to add an info icon and title just like my button on my form? Duncan
... View more
11-28-2012
08:06 AM
|
0
|
0
|
2207
|
|
POST
|
You could just use Quantum GIS, it's completely free... Have a look here
... View more
11-23-2012
06:23 AM
|
0
|
0
|
1451
|
|
POST
|
Simon, Have you tried looking at the Help in ArcMap, at some point you are going to have to... There is lots of information about creating watershed boundaries. Duncan
... View more
11-17-2012
10:03 AM
|
0
|
0
|
1134
|
|
POST
|
Armin, I'm curious, how did you determine it was the IDataStatistics interface that was causing you problems, you say it runs OK then crashes, what made you decide it was that and not something else? I only ask as I am having a 10.1 addin I am creating crashing with a heap corruption error at seemingly random times. It's such a catastrophic error that none of my error-trapping catches it, ArcMap simply bombs out to Windows. Duncan
... View more
11-09-2012
06:12 AM
|
0
|
0
|
2664
|
|
POST
|
Domenico, Thank you for your reply. I've had a look at the links. I now know that QueryFilterClass is a managed class but I am unsure why one would create it? Is it best practise to now use a managed class for say memory issues? Why should I stop creating my QueryFilter class and start creating QueryFilterClass classes? Duncan
... View more
11-09-2012
12:34 AM
|
0
|
0
|
1792
|
|
POST
|
All ArcObject Gurus, For years when I've been developing ArcObjects VB code to create a QueryFilter I have used the following to create the object: Dim pQueryFilter As IQueryFilter pQueryFilter = New QueryFilter I'm now redeveloping a 9.3 project into 10.1 using Visual Studio 2012 (VB). When I look at the code snippet examples I now see: Dim pQueryFilter As IQueryFilter pQueryFilter = New QueryFilterClass If one looks at the help file on IQueryFilter Interface it says only the class QueryFilter implements the IQueryFilter interface (as well as a bunch of other classes) but no mention of the QueryFilterClass. If I change my code to use QueryFilterClass everything compiles as normal. So what is the difference, is there some reason why ESRI are showing snippet examples with this class? Is there some sort of performance issue? Duncan
... View more
11-08-2012
05:53 AM
|
1
|
3
|
3538
|
|
POST
|
Harry, Are you showing the complete code in your uploaded sample? If you search the Help file for FieldInfo the example given in the help shows that this object is obtained via the Describe Object. Maybe your fieldInfo object is invalid? Duncan
... View more
11-04-2012
09:46 AM
|
0
|
0
|
1458
|
|
POST
|
David, Just to clarify when you say "in memory layer", are you saying you have created a FeatureClass in an InMemoryWorkSpace? FYI I knocked together some code in VBA on a FeaturelClass in the in_memory workspace which I created using the Table Select tool. My code worked fine and the only difference I can see is that you are not setting the QueryFilter. This code worked for me: Public Sub test()
Dim pMXDocument As IMxDocument
Set pMXDocument = ThisDocument
Dim pMap As IMap
Set pMap = pMXDocument.FocusMap
Dim pLayer As ILayer
Set pLayer = pMap.Layer(0)
Dim pFeatureLayer As IFeatureLayer
Set pFeatureLayer = pLayer
Dim pFeatureClass As IFeatureClass
Set pFeatureClass = pFeatureLayer.FeatureClass
Dim pTable As ITable
Set pTable = pFeatureClass
Dim pTableSort As ITableSort
Set pTableSort = New TableSort
With pTableSort
.Ascending("Strahler") = False
Set .Table = pTable
Set .QueryFilter = Nothing
.Fields = "Strahler"
.Sort Nothing
End With
' Get sorted cursor and write to debug window
Dim pCursor As ICursor
Set pCursor = pTableSort.Rows
Dim pRow As IRow
Set pRow = pCursor.NextRow
Do While Not pr Is Nothing
Debug.Print pRow.Value(pRow.Fields.FindField("Strahler"))
Set pRow = pCursor.NextRow
Loop
End Sub Duncan
... View more
11-04-2012
06:35 AM
|
0
|
0
|
1120
|
| 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 |
Wednesday
|