Ok, the ported sample is up on arcgis.com as the Cut Polygons Without Selection Tool code sample.This is a visual studio 2010 project that will create a 10.1 desktop add-in for use in ArcMap.The code is included so you can generally see the pattern for creating edit tools that use the sketch in the 10.x framework.The tool was created using the esri add-in templates in visual studio by creating a construction tool but without the category part, thus you still get an edit tool template that uses the sketch but without it being a construction tool. The code from the OnFinishSketch method in the engine edit task was then ported to the OnSketchFinished method in the add-in.You can create COM dll for use in 10.0.x using the same pattern but by using the Desktop ArcMap Edit Tool template in the ArcGIS New Item wizard when creating a new class in your com dll project. Stick the code in the m_editEvents_OnSketchFinished method. Note that this has to be a com dll at 10.0.x because add-ins do not support implementing interfaces until 10.1, and you need to implement ISketchTool to use the sketch. Consider changing the ArrayList to generics and use a different method for the sketch-polygon intersection if you take this on.
It's been quite a while since I was here. The attached is the new deployment package of the COM component version I just recompile today. I modified the launch conditions to make it works for both ArcGIS 10.0 and 10.1.For those who have trouble installing the add-in for 10.1, you can try this COM component version. It should be as same as the add-in version that Sean Jones created for 10.1.Let me know if you run into any troubles with the installer.
Thanks. My problem is I don't understand how to install it.
With ArcGIS Desktop v10.1, you need to use the addin that sean_jones created in post # 8
I'm using 10.1. I tired to install the tool, but get a message saying I need to install version 10. Can we get the tool to work with 10.1?
Hi Ben,I know that this thread has been for awhile, were you be able to re-create this tool?
The reason you can't use this sample in ArcMap is that it is made for engine.Implements ESRI.ArcGIS.Controls.IEngineEditTask Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type) Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID) EngineEditTasks.Register(regKey) End Sub ''' <summary> ''' Required method for ArcGIS Component Category unregistration - ''' Do not modify the contents of this method with the code editor. ''' </summary> Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type) Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID) EngineEditTasks.Unregister(regKey) ... #Region "Private Members" Private m_engineEditor As IEngineEditor Private m_editSketch As IEngineEditSketch Private m_editLayer As IEngineEditLayers #End Region End SubYou could try to use the ArcGIS developer templates (installed with the arcgis developer kit) to create an ArcMap edit task and copy the code (not all the code, just the methods that make up the interface) and the member variables. You would have to convert all the classes specific to engine to the a similar class specific to ArcMap. Probably a task that an ArcObjects developer could undertake.
Implements ESRI.ArcGIS.Controls.IEngineEditTask Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type) Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID) EngineEditTasks.Register(regKey) End Sub ''' <summary> ''' Required method for ArcGIS Component Category unregistration - ''' Do not modify the contents of this method with the code editor. ''' </summary> Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type) Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID) EngineEditTasks.Unregister(regKey) ... #Region "Private Members" Private m_engineEditor As IEngineEditor Private m_editSketch As IEngineEditSketch Private m_editLayer As IEngineEditLayers #End Region End Sub
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.