POST
|
I'm trying to perform a Table Query using the PerformAttributeQuery snipet and I'm just trying to figure out how to select a table, for the function.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim queryFilter As String = "Code = '" + ComboBox1.Text.Trim + "'"
Dim table as ESRI.ArcGIS.Geodatabase.ITable = ?????
MsgBox(PerformAttributeQuery(table, queryFilter))
End Sub
Public Function PerformAttributeQuery(ByVal table As ESRI.ArcGIS.Geodatabase.ITable, ByVal whereClause As System.String) As ESRI.ArcGIS.Geodatabase.ICursor
Dim queryFilter As ESRI.ArcGIS.Geodatabase.IQueryFilter = New ESRI.ArcGIS.Geodatabase.QueryFilterClass()
queryFilter.WhereClause = whereClause
Dim cursor As ESRI.ArcGIS.Geodatabase.ICursor = table.Search(queryFilter, False)
Return cursor
End Function
... View more
07-12-2012
09:37 AM
|
0
|
17
|
2833
|
POST
|
You are making me nervous about upgrading 10 to 10.1. Have you contacted ESRI Tech Support about this issue?
... View more
07-09-2012
06:50 AM
|
0
|
0
|
426
|
POST
|
Iâ??m able to get the Geometry of a Feature Class, but I would like to get the Geometry of the selected Feature. I think I have to find a way to get the Index of the selected, before getting the Geometry. I'm just having a little problem with it. This is what I have:
' Check if Zoning Polygon is in ArcMap
Dim pMap As IMap = My.ArcMap.Document.ActiveView
Dim featLayerUid As New UIDClass
featLayerUid.Value = "{40A9E885-5533-11D0-98BE-00805F7CED21}"
Dim enumLayer As IEnumLayer = pMap.Layers(featLayerUid, True)
enumLayer.Reset()
Dim layer As ILayer = enumLayer.Next
Dim fLayer As IFeatureLayer = CType(layer, IFeatureLayer)
Do While Not (layer Is Nothing)
If CType(fLayer.FeatureClass, IDataset).Name = "CSJGISSDE.GISDATA.Zoning" Or
CType(fLayer.FeatureClass, IDataset).Name = "Zoning" Then
Exit Do
End If
layer = enumLayer.Next()
Loop
If layer Is Nothing Then
MsgBox("Zoning Polygon Feature Class is missing.")
Return
End If
' Check if feature is selected
Dim featureSelection As IFeatureSelection = TryCast(fLayer, IFeatureSelection)
If featureSelection.SelectionSet.Count() = 0 Then
MsgBox("No Selection")
Return
End If
' Get the Geometry.
Dim shapeFieldName As String = fLayer.FeatureClass.ShapeFieldName
Dim shapeFieldIndex As Integer = fLayer.FeatureClass.FindField(shapeFieldName)
Dim fields As IFields = fLayer.FeatureClass.Fields
Dim shapeField As IField = fields.Field(shapeFieldIndex)
Dim geometryDef As IGeometryDef = shapeField.GeometryDef
Dim featureShape As String = ""
Select Case geometryDef.GeometryType
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint
featureShape = "Point"
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryMultipoint
featureShape = "Multipoint"
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline
featureShape = "Polyline"
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon
featureShape = "Polygon"
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryMultiPatch
featureShape = "MultiPatch"
End Select
MsgBox(featureShape)
... View more
07-05-2012
08:07 AM
|
0
|
1
|
2217
|
POST
|
How can I check if the Edit Session is on? With my current code, ArcMap crashes when not in Edit Session. I'd like to put a warning for the user to start an Edit Session, if they forgot. Dim pEnumFeature As ESRI.ArcGIS.Geodatabase.IEnumFeature Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature Dim pEditor As ESRI.ArcGIS.Editor.IEditor Dim featureCode As String Dim def As String pEditor = My.ArcMap.Application.FindExtensionByName("esriEditor.Editor") pEnumFeature = pEditor.EditSelection pEnumFeature.Reset() pFeature = pEnumFeature.Next pEditor.StartOperation()
... View more
06-28-2012
10:06 AM
|
0
|
3
|
736
|
POST
|
I guess the only way to do it, is to create a Toolbar project and include the files from my other add-ins (projects), then modify the Config.esriaddinx file to include the buttons for each tools (add-ins), in the toolbar. There should be an easier way to call other add-ins, in the same fashion as calling executables.
... View more
06-28-2012
03:38 AM
|
0
|
0
|
188
|
POST
|
I'm building a custom toolbar and I want to include 4 tools (add-ins) that I've created, in it. How can I set the tool path for each buttons in the toolbar? Something like: <Button refID="G:\Add-Ins\Public\findaddress.esriaddin" />
... View more
06-27-2012
09:12 AM
|
0
|
2
|
1207
|
POST
|
Thanks Neil, that make sense. I like the option to have the tool disabled (button grey out), when in Layout VIew. I'm just unsure how to build the condition to check if the Layout View is on, tho. I've been reading on the IActiveView and IMxDocument, but I can't find solutions on how to determine which view is activated. This is what I use in my code, to set the Active View:
Dim pMap As IMap = My.ArcMap.Document.ActiveView
... View more
06-27-2012
05:42 AM
|
0
|
0
|
268
|
POST
|
I???ve build a few ArcMap Add-ins and they work fine, when running in the Data View mode. But, if I???m in the Layout View and I start the Add-Ins, ArcMap crashes. Is there a way to get a message, instead of a crash, when the user is not in Data View? Or, is there a way to have an Add-In to work in both Data View and Layout view?
... View more
06-27-2012
04:14 AM
|
0
|
4
|
512
|
POST
|
Forgot to add: pEditor.StartOperation() and pEditor.StopOperation("UpdateFields")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pEnumFeature As ESRI.ArcGIS.Geodatabase.IEnumFeature
Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
Dim pEditor As ESRI.ArcGIS.Editor.IEditor
pEditor = My.ArcMap.Application.FindExtensionByName("esriEditor.Editor")
pEnumFeature = pEditor.EditSelection
pEnumFeature.Reset()
pFeature = pEnumFeature.Next
pEditor.StartOperation()
Do Until pFeature Is Nothing
pFeature.Value(pFeature.Fields.FindField("Source")) = "Coordinates"
pFeature.Store()
pFeature = pEnumFeature.Next
Loop
pEditor.StopOperation("UpdateFields")
End Sub
... View more
06-26-2012
09:17 AM
|
0
|
0
|
155
|
POST
|
Thanks Ken, I got it to work. The problem was with this line:
Dim pEditor As ESRI.ArcGIS.Editor.IEditor
pEditor = m_application.FindExtensionByName("esriEditor.Editor") I ended up using:
Dim pEditor As ESRI.ArcGIS.Editor.IEditor
pEditor = My.ArcMap.Application.FindExtensionByName("esriEditor.Editor") The whole code:
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.ArcMapUI
Imports ESRI.ArcGIS.Framework
Imports System.Windows.Forms
Imports ESRI.ArcGIS.Editor
Public Class EaseRowEditorForm
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pEnumFeature As ESRI.ArcGIS.Geodatabase.IEnumFeature
Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
Dim pEditor As ESRI.ArcGIS.Editor.IEditor
pEditor = My.ArcMap.Application.FindExtensionByName("esriEditor.Editor")
pEnumFeature = pEditor.EditSelection
pEnumFeature.Reset()
pFeature = pEnumFeature.Next
Do Until pFeature Is Nothing
pFeature.Value(pFeature.Fields.FindField("Source")) = "Coordinates"
pFeature.Store()
pFeature = pEnumFeature.Next
Loop
End Sub
End Class
... View more
06-26-2012
09:05 AM
|
0
|
0
|
155
|
POST
|
Ken, I still get the My.ArcMap.Editor in blue, after adding the Editor assembly. [ATTACH=CONFIG]15495[/ATTACH]
... View more
06-26-2012
08:19 AM
|
0
|
0
|
484
|
POST
|
Sorry, but I'm totally lost, nothing seems to work. Are you saying that I have to use an Add-in, to build an ArcMap add-in? Here's a screenshot of my code: [ATTACH=CONFIG]15486[/ATTACH]
... View more
06-26-2012
07:18 AM
|
0
|
0
|
484
|
POST
|
Thanks Ken. Is there anymore to the code? I'm trying to understand it and it doesn't like this statment: My.ArcMap.Editor. It's underlined in blue.
... View more
06-26-2012
06:39 AM
|
0
|
0
|
484
|
POST
|
So, no one has a sample of how to insert values on the attribute table, for selected features in Edit mode? I don't want to select the Features by Query. The user will create a new feature and by default, new features are selected in the attribute table. All I want to do, is insert values in every fields, for the selected.
... View more
06-26-2012
05:47 AM
|
0
|
0
|
484
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|