+ Reply to Thread
Results 1 to 18 of 18

Thread: Cut polygons without selection edit task for arcmap v10 sp3

  1. #1
    Benjamin Wragg
    Join Date
    Oct 2011
    Posts
    12
    Points
    0
    Answers Provided
    0


    0

    Default Cut polygons without selection edit task for arcmap v10 sp3

    Hi all,

    I've spent days now trying to get the "Cut polygons without selection" sample (
    http://help.arcgis.com/en/sdk/10.0/a...0000077000000/) to work with ArcMap v10 sp3 (ArcView). We need this extension so we can trace selected features without selecting the polygon we want to split. I know what your going to say..."just use the normal 'Cut polygon tools' with the new trace tool that doesn't require to select features' but we can't use this tool as we have really complex data and we have to trace long distances. As a result when we have tested the new 'trace without a selection' feature we end up accidentally tracing many small features. Hence we would like to get this old sample working.

    I'm not a vb developer but with some help from a developer I've downloaded the vb.net solution and compiled it. I've run ESRIRegAsm, select Desktop and it succeeds in registering it. I've checked the dependancies with dependancy walker and its all good. I've checked the Components.exe program and I can see it registers itself under "ESRI Engine Edit Tasks" but not under "ESRI Edit Tasks" which is the spot you would put it in 9.3 and 9.2. When I run ArcMap I can't see the task 'Cut Polygon without selection' in the task list. I assume this is because its not added in the Components.exe under "ESRI Edit Tasks". If I manually try to add it throws an error saying 'Can't Load Library'.

    So is there a way to get this sample to compile and install so that it runs as a task in the normal Editor toolbar in ArcMap? Or have I missed some readme that explains this sample is only available in the Engine?

    Also is there a reason ESRI doens't compile this as a dll like they used to for previous versions?

    Thanks,

    bwragg

  2. #2
    Alexander Gray
    Join Date
    Apr 2010
    Posts
    685
    Points
    201
    Answers Provided
    32


    1

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    The reason you can't use this sample in ArcMap is that it is made for engine.

    Code:
    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
    You 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.

  3. #3
    Benjamin Wragg
    Join Date
    Oct 2011
    Posts
    12
    Points
    0
    Answers Provided
    0


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Quote Originally Posted by agray1 View Post
    The reason you can't use this sample in ArcMap is that it is made for engine.

    Code:
    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
    You 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.
    Thanks agray, I had an feeling that might be the answer I got. Guess we'll have to start trying to convert the code. Thanks again for your time.

    I'm sure I'm not the first person who's had to do this...anyone out there got a compiled dll already???

    Thanks

  4. #4
    Thai Truong
    Join Date
    Oct 2010
    Posts
    97
    Points
    102
    Answers Provided
    13


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Hi Ben,

    I know that this thread has been for awhile, were you be able to re-create this tool?

  5. #5
    Benjamin Wragg
    Join Date
    Oct 2011
    Posts
    12
    Points
    0
    Answers Provided
    0


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Quote Originally Posted by ttruong View Post
    Hi Ben,

    I know that this thread has been for awhile, were you be able to re-create this tool?
    Hi, Sorry for the late reply, no I haven't been able to re-create this tool but would love to hear any information you may have on this.

    Thanks,

    bwragg

  6. #6
    John Sobetzer

    Join Date
    Apr 2010
    Posts
    1,006
    Points
    235
    Answers Provided
    24


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    I found this to be an essential tool in 9x since it: 1. allowed cutting without having to select a polygon (saving the time and clicks involved in changing to the select tool, making a selection and then changing back to the sketch tool), and 2. it allowed cutting using selected features and the trace tool.

    I would still like this tool in 10x. I went through a lot of the same wasted effort with the developer sample before finding out it was only for Engine. It could avoid the selection clicks when using a sketch to cut a polygon. As for using the trace tool, in 10x the cut polygon tool combined with the trace tool is really nice, but tracing can be difficult in places where there are many features at the scale one is editing. So in 10x I'd like both the built in and the cut without selecting versions, and in both have the ability to use 10's trace without selecting, or to use 9's trace using only the selected features for more control.

  7. #7
    Sean Jones

    Join Date
    Oct 2009
    Posts
    229
    Points
    166
    Answers Provided
    26


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    I'll take a crack at the conversion and post it up on editing labs.

    In the meantime you can:
    Union the selected set of lines you would have traced, into an empty temporary layer.
    Using the cut polygon tool, replace the sketch with the line you just unioned.
    Sean Jones
    Esri Product Engineer
    Desktop Editing

  8. #8
    Sean Jones

    Join Date
    Oct 2009
    Posts
    229
    Points
    166
    Answers Provided
    26


    2
    This post is marked as the answer

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    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.
    Sean Jones
    Esri Product Engineer
    Desktop Editing

  9. #9
    John Sobetzer

    Join Date
    Apr 2010
    Posts
    1,006
    Points
    235
    Answers Provided
    24


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Excellent! It works either with the feature templates or with my customized classic editing in 10.1. Thank you very much Sean.

  10. #10
    Thai Truong
    Join Date
    Oct 2010
    Posts
    97
    Points
    102
    Answers Provided
    13


    1

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Attached is a COM component version of this tool allows us to create sketch of cut line by using other sketch tools like: Right Angle, Arc, End Point Arc, Tangent Curve, & Bezier Curve.

    Click image for larger version

Name:	tool.png
Views:	66
Size:	40.2 KB
ID:	15790

    To use:
    1. Install this tool
    2. Start Editing from Editor toolbar.
    3. Select a polygon feature class that you want to edit.
    4. Select Cut Polygons Without Selection tool from Construction Tools.
    5. Sketch on map to create a line that cuts through the original polygon(s) as desired.
    6. You can create your sketch with any Feature Construction (straight lines, with curves, or tracing from the shapes of other features) to place vertices in the sketch. You’ll be able to use snap, too.
    7. Double click, press F2 key, or Right-click anywhere on the map and choose Finish Sketch to complete you cut line.
    Attached Files

  11. #11
    Robert Bonar
    Join Date
    Jul 2012
    Posts
    3
    Points
    0
    Answers Provided
    0


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    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?

  12. #12
    Benjamin Wragg
    Join Date
    Oct 2011
    Posts
    12
    Points
    0
    Answers Provided
    0


    0

    Red face Re: Cut polygons without selection edit task for arcmap v10 sp3

    sean_jones & ttruong thankyou so much! I just tried the compiled version in 10 sp5 and it works great.

    We really appreciate your efforts. Thanks again.

  13. #13
    Thai Truong
    Join Date
    Oct 2010
    Posts
    97
    Points
    102
    Answers Provided
    13


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Quote Originally Posted by rbonar View Post
    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?
    With ArcGIS Desktop v10.1, you need to use the addin that sean_jones created in post # 8

  14. #14
    Robert Bonar
    Join Date
    Jul 2012
    Posts
    3
    Points
    0
    Answers Provided
    0


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Quote Originally Posted by ttruong View Post
    With ArcGIS Desktop v10.1, you need to use the addin that sean_jones created in post # 8
    Thanks. My problem is I don't understand how to install it.

  15. #15
    Jason Johnson
    Join Date
    Jan 2012
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Quote Originally Posted by rbonar View Post
    Thanks. My problem is I don't understand how to install it.
    I also do not know how to proceed with installing on 10.1.

    I have previously registered the .dll and added this in 9.3.x, but I cannot find "esriRegSvr32.exe" in Program Files\ArcGIS\Bin for 10.1.

    Am I missing a step?


    These are the instructions I wrote for myself for a 9.3.x install, perhaps someone can tell me where I am going wrong.




    Download and save correctly
    1.Download and unzip your add in to a file location you desire.
    2.Open the location and find the .dll file containing the name of your add-in.
    3.Save a copy at :/Program Files/ArcGIS/Bin

    Register the .dll
    1.Open Windows Explorer and navigate to C:\Program Files\ArcGIS\Bin.
    2.Find “esriRegSvr32.exe” and run it.
    3.Check the “Register Files” and “Individual File” boxes, then click "select".
    3.Find your .dll in the ArcGIS\Bin folder, then hit OK.

    Add your .dll to the ArcGIS edit tasks
    1.Open Windows Explorer and navigate to C:\Program Files\ArcGIS\Bin.
    2.Find “categories.exe” and run it.
    3.Scroll to the folder “ESRI Edit Tasks”, select it, then click “Add Object.
    4.Navigate to C:\Program Files\ArcGIS\Bin and select your .dll.

    Verify
    1.Start an edit session and see if the new tool is available in the Task dropdown.
    2.If not, open the Editor Properties dialog; at Editor / Options / Edit Tasks.
    3.Select the Add button and click on the Desired add in.
    4.This should add the "Zipper task" or "Cut polygon without selection" to the list of tasks.

    Thanks


    I retract my previous inquiry on how to install on 10.1.

    I used "the force" and figured it out; actually pretty easy, easier than in 9.3.x

    Just double click on "CutPolygonsWithoutSelection.esriAddIn" that comes in the zip file.

    Then simply add it by the same way you add any tool to the toolbar.

    Thanks for making it!
    Last edited by jajohnso; 11-06-2012 at 01:11 PM. Reason: figured it out on my own

  16. #16
    Thai Truong
    Join Date
    Oct 2010
    Posts
    97
    Points
    102
    Answers Provided
    13


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    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.
    Attached Files

  17. 04-03-2013 02:44 PM


  18. #17
    Mathieu Beaudry
    Join Date
    Mar 2014
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Quote Originally Posted by sean_jones View Post
    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.
    Hello , i try to download your source code in the link above but it says that i don't have authorisation to see this content. I'm logged with my esri global account... Any tips ? Thx

  19. #18
    Sean Jones

    Join Date
    Oct 2009
    Posts
    229
    Points
    166
    Answers Provided
    26


    0

    Default Re: Cut polygons without selection edit task for arcmap v10 sp3

    Sorry about that, I've shared it publicly. We're reorganizing those editing labs samples.
    Sean Jones
    Esri Product Engineer
    Desktop Editing

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts