POST
|
I need to query a table that has non spatial data and is available on the source tab. If I physically select the table, the code below code works. I don't want to be required to select the table in order to get the table reference and do the query. Can someone tell me how to do this using the table name? Thanks Brian Dim mxDocument As ESRI.ArcGIS.ArcMapUI.IMxDocument = CType(My.ArcMap.Application.Document, ESRI.ArcGIS.ArcMapUI.IMxDocument) Dim contentsView As ESRI.ArcGIS.ArcMapUI.IContentsView = mxDocument.ContentsView(1) ' 0 = usually the Display tab, 1 = usually the Source tab Dim table As ESRI.ArcGIS.Geodatabase.ITable = CType(contentsView.SelectedItem, ESRI.ArcGIS.Geodatabase.ITable) Dim cursor As ICursor = PerformAttributeQuery(table, "OBJECTID = 1")
... View more
12-09-2011
12:51 PM
|
0
|
1
|
1930
|
POST
|
Good point. Something else to figure out how to do. I appreciate your suggestions. Brian
... View more
12-02-2011
12:36 PM
|
0
|
0
|
470
|
POST
|
Alexander and Neil, Thanks you both for the suggestions. The following code list the layers in a list box of any selected features. It seems to work but do you see any problems with this approach. Brian Public Sub GetLayer() Dim pMxDoc As IMxDocument pMxDoc = CType(My.ArcMap.Application.Document, IMxDocument) Dim pMap As IMap pMap = pMxDoc.FocusMap Dim pEnumLayer As IEnumLayer pEnumLayer = pMap.Layers pEnumLayer.Reset() Dim pLayer As ILayer pLayer = pEnumLayer.Next Dim pFLayer As IFeatureLayer = Nothing Do While Not pLayer Is Nothing If TypeOf pLayer Is IFeatureLayer Then pFLayer = TryCast(pLayer, IFeatureLayer) Dim sel As IFeatureSelection sel = TryCast(pFLayer, IFeatureSelection) If sel.SelectionSet.Count > 0 Then ListBox1.Items.Add(pLayer.Name) ' this adds the layer name to a list box End If End If pLayer = pEnumLayer.Next Loop End Sub
... View more
12-02-2011
08:00 AM
|
0
|
0
|
470
|
POST
|
I need to get the layer of a single selcted object. Using the selection tool, if a user selects a polygon, I want to determine programatically (vb.net) what layer that object is on. Thanks Brian
... View more
12-01-2011
06:25 PM
|
0
|
5
|
1589
|
POST
|
Hi Brain, try with a selection set and, then, a cursor. Mar Mar - thanks for the suggestion. Brian
... View more
11-28-2011
07:59 AM
|
0
|
0
|
1090
|
POST
|
Richard, Thank you very much for the code. It works perfectly. Brian
... View more
11-28-2011
07:56 AM
|
0
|
0
|
1090
|
POST
|
I am new to using arcobjects and need to do something that should be very simple. Assuming a user has selected a point feature, I simply need to get a specific attribute value from a known field. For example, a user selects a USGS gage that is represented as a point. I need to get the gage ID from the Gage_ID field in the attribute table to do some additional processing. I am using Visual Studio 2010 and vb.net. Any help would be appreciated. Thanks Brian
... View more
11-25-2011
07:26 AM
|
0
|
4
|
4511
|
Online Status |
Offline
|
Date Last Visited |
10-05-2022
10:22 PM
|