|
POST
|
Why not just use the feature's Shape property to get a geometry, which has the GeometryType property?
... View more
07-05-2012
08:37 AM
|
0
|
0
|
1173
|
|
POST
|
This is something that's bitten me when using ViewStacks. You have to set the the ViewStack's creationPolicy to "all", otherwise, many things that are contained in the stack won't be created at startup. From the help: Containers with multiple views, such as the ViewStack and Accordion, do not immediately create all of their descendants, but only those descendants that are visible in the initial view. Flex defers the instantiation of descendants that are not initially visible until the user navigates to a view that contains them.
... View more
07-05-2012
07:28 AM
|
0
|
0
|
1354
|
|
POST
|
There's the IGeoProcessorSettings::AddOutputToMap property
... View more
07-05-2012
06:56 AM
|
0
|
0
|
1098
|
|
POST
|
Here is how I create an in-memory feature class in my projects, using the Geoprocessor. 'pSR is a variable containing a spatial reference 'in this case, I'm creating an in-memory point feature class pFeatureClass = CreateInMemoryFeatureClass2("temporary", ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint, pSR) Public Function CreateInMemoryFeatureClass2(ByVal Name As String, InShapeType As ESRI.ArcGIS.Geometry.esriGeometryType, InSR As ESRI.ArcGIS.Geometry.ISpatialReference3) As ESRI.ArcGIS.Geodatabase.IFeatureClass Dim CreateFC As New ESRI.ArcGIS.DataManagementTools.CreateFeatureclass Dim ShapeType As String Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2 Try Using releaser As New ESRI.ArcGIS.ADF.ComReleaser releaser.ManageLifetime(CreateFC) Select Case InShapeType Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint ShapeType = "Point" Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline ShapeType = "Line" Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon ShapeType = "Polygon" Case Else Return Nothing End Select CreateFC.out_path = "in_memory" CreateFC.out_name = Name CreateFC.geometry_type = ShapeType CreateFC.spatial_reference = InSR Result = RunTool(CreateFC, Nothing) If Result Is Nothing Then System.Windows.Forms.MessageBox.Show("Could not create InMemory dataset") Return Nothing End If Return ReturnObjectfromResult(Result, "Feature Class") End Using Catch ex As Exception System.Windows.Forms.MessageBox.Show(ex.ToString, "Create InMemory Featureclass error") Return Nothing End Try End Function Friend Function ReturnObjectfromResult(ByVal result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2, ByVal Type As String) As Object Dim GPVal As ESRI.ArcGIS.Geodatabase.IGPValue Dim InMemFC As String Dim GPUtil As ESRI.ArcGIS.Geoprocessing.IGPUtilities3 = New ESRI.ArcGIS.Geoprocessing.GPUtilities Try GPVal = result.GetOutput(0) InMemFC = GPVal.GetAsText() Select Case Type Case "Feature Class" Return GPUtil.OpenFeatureClassFromString(InMemFC) Case "Table" Return GPUtil.OpenTableFromString(InMemFC) End Select Catch ex As Exception System.Windows.Forms.MessageBox.Show(ex.ToString, "Return FeatureClass error") Return Nothing End Try End Function Friend Function RunTool(ByVal Process As ESRI.ArcGIS.Geoprocessor.IGPProcess, ByVal TC As ESRI.ArcGIS.esriSystem.ITrackCancel2) As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2 Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2 Dim GP As New ESRI.ArcGIS.Geoprocessor.Geoprocessor Try Result = CType(GP.Execute(Process, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2) If Result.Status <> ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded Then ReturnMessages(Result, "Geoprocessing Error") Catch ex As Exception System.Windows.Forms.MessageBox.Show(ex.ToString, "Run Geoprocessor") End Try Return Result End Function Private Sub ReturnMessages(ByVal pResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2, ByVal Title As String) Dim ErrorMessage As String If pResult.MessageCount > 0 Then For Count As Integer = 0 To pResult.MessageCount - 1 ErrorMessage += pResult.GetMessage(Count) Next End If System.Windows.Forms.MessageBox.Show(ErrorMessage, Title) End Sub
... View more
07-03-2012
07:13 AM
|
0
|
0
|
833
|
|
POST
|
You can check the edit state by using IEditor::Editstate. An example to check whether an edit session has been started on the selected map: If My.ArcMap.Editor.EditState <> ESRI.ArcGIS.Editor.esriEditState.esriStateEditing then As for ArcMap crashing, do you use Try..Catch exception handling?
... View more
06-28-2012
10:21 AM
|
0
|
0
|
1072
|
|
POST
|
You can find that at the Customer Care Portal, in the Software Download section.
... View more
06-28-2012
07:18 AM
|
0
|
0
|
1292
|
|
POST
|
There is the option to use the "classic" editing environment. It take a little digging to change it, unfortunately. Open the tool AdvancedArcMapSettings.exe (found in C:\Program Files (x86)\ArcGIS\Desktop10.0\Utilities) and select the Editor tab. Unchecking the checkbox "Create features using templates" reverts back to the 9.x editing environment.
... View more
06-28-2012
06:59 AM
|
0
|
0
|
1298
|
|
POST
|
You left off the quotes and if you're using the Create File Geodatabase command, the geodatabase should have the suffix "gdb". arcpy.CreateFileGDB_management ("C:/Pru", "Dad.gdb", "9.3")
... View more
06-27-2012
10:50 AM
|
0
|
0
|
1115
|
|
POST
|
Instead of adding the MouseEvent.Click event, you should add the MapMouseEvent.MAP_CLICK event
... View more
06-27-2012
06:49 AM
|
0
|
0
|
537
|
|
POST
|
I'm glad that worked out. It's curious that you can use My.ArcMap but not My.ArcMap.Editor
... View more
06-26-2012
09:13 AM
|
0
|
0
|
999
|
|
POST
|
I notice that you don't have the line Inherits ESRI.ArcGIS.Desktop.AddIns.Extension in your code. This was included in your previous code attachment Also, you'll need to add the line pFeature = pEnumFeature.Next before you start the Do Loop.
... View more
06-26-2012
08:59 AM
|
0
|
0
|
4528
|
|
POST
|
It looks like you don't have a reference to the Editor assembly in your project. Once you've added that, you won't need the additional lines in my previous post. Also, you should probably use the other looping structure (Do until pFeature is Nothing). I used For i As Integer = 0 To My.ArcMap.Editor.SelectionCount - 1 because I wanted to do something different with the the first feature. [ATTACH=CONFIG]15487[/ATTACH]
... View more
06-26-2012
07:29 AM
|
0
|
0
|
3529
|
|
POST
|
If you're not using an add-in, then get a reference to the editor using
dim pEditor As ESRI.ArcGIS.Editor.IEditor
pEditor = m_application.FindExtensionByName("esriEditor.Editor")
pEnumFeature = pEditor.EditSelection
... View more
06-26-2012
06:52 AM
|
0
|
0
|
3529
|
|
POST
|
Here's how I do that in my editor extension Add-in. I have added a command to the edit tool context menu which allows the user to assign attributes to the selected features.
Dim pEnumFeature As ESRI.ArcGIS.Geodatabase.IEnumFeature
Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
pEnumFeature = My.ArcMap.Editor.EditSelection
pEnumFeature.Reset()
For i As Integer = 0 To My.ArcMap.Editor.SelectionCount - 1
pFeature = pEnumFeature.Next
' set the values for the feature
'or you could make a loop using
' pFeature = pEnumFeature.Next
' Do until pFeature is Nothing
... View more
06-26-2012
06:11 AM
|
0
|
0
|
3529
|
|
POST
|
Thanks Ken However, for me it is not restricted to background geoprocessing. - Graeme You should contact Esri support to add this information to the bug.
... View more
06-22-2012
06:25 AM
|
0
|
0
|
3636
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|