Select to view content in your preferred language

Break circle where user clicks

686
1
Jump to solution
06-09-2014 02:20 PM
TonyE
by
Emerging Contributor
Hi, I'm having some issues right now with breaking a circle where a user clicks.  The way I'm currently doing it (which works for straight polylines) is to take the Feature object and cast it to IFeatureEdit2.  Afterwards I use the .SplitWithUpdate(IPoint userPoint) method on the FeatureEdit2 object. 

However when I try this with a Circle feature (clicking on point 1) it creates two breaks and makes two arcs as in the image attached.  I would like it to just keep one arc with a break at the point the user clicked and no where else.  This way I could click on point2 later and have two arcs split by the two polylines crossing them and select/delete whatever one I no longer need. 

When I click for the second time to break the line again it works as expected, however I'm left with 3 arcs instead of the 2 I want.
0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Alum
Hi, I'm having some issues right now with breaking a circle where a user clicks.  The way I'm currently doing it (which works for straight polylines) is to take the Feature object and cast it to IFeatureEdit2.  Afterwards I use the .SplitWithUpdate(IPoint userPoint) method on the FeatureEdit2 object. 

However when I try this with a Circle feature (clicking on point 1) it creates two breaks and makes two arcs as in the image attached.  I would like it to just keep one arc with a break at the point the user clicked and no where else.  This way I could click on point2 later and have two arcs split by the two polylines crossing them and select/delete whatever one I no longer need. 

When I click for the second time to break the line again it works as expected, however I'm left with 3 arcs instead of the 2 I want.


The behavior is expected.  Circles in ArcMap are simply lines that have a starting point and ending point that meet.  They are derived from finite lines and they are incapable of being infinitely long lines with no beginning or ending like an ideal circle.

If this were a straight line you would not expect the first click to automatically move the original beginning or ending point of the line.  You would expect the first click to create 2 arcs.  Circles behave exactly the same way, they split on the first click to create 2 lines.  They have just been obscuring where their beginning and ending point was unless you had viewed their edit sketch.

So to get the behavior you want you have to make the first click reposition the beginning of the circle to the location clicked, then the second click can split it at another position.  So the piece of the circle that is originally the beginning segment of the circle has to first split, then merge the end of the second piece (Arc2 at the unwanted break point) to the beginning of the first piece (Arc1 at the unwanted break point) so it continues to be a single circular line.  Then another click can split the circle elsewhere.  Some method of distinguishing a click that repositions the circle starting point from a click that splits the circle should be made.

View solution in original post

0 Kudos
1 Reply
RichardFairhurst
MVP Alum
Hi, I'm having some issues right now with breaking a circle where a user clicks.  The way I'm currently doing it (which works for straight polylines) is to take the Feature object and cast it to IFeatureEdit2.  Afterwards I use the .SplitWithUpdate(IPoint userPoint) method on the FeatureEdit2 object. 

However when I try this with a Circle feature (clicking on point 1) it creates two breaks and makes two arcs as in the image attached.  I would like it to just keep one arc with a break at the point the user clicked and no where else.  This way I could click on point2 later and have two arcs split by the two polylines crossing them and select/delete whatever one I no longer need. 

When I click for the second time to break the line again it works as expected, however I'm left with 3 arcs instead of the 2 I want.


The behavior is expected.  Circles in ArcMap are simply lines that have a starting point and ending point that meet.  They are derived from finite lines and they are incapable of being infinitely long lines with no beginning or ending like an ideal circle.

If this were a straight line you would not expect the first click to automatically move the original beginning or ending point of the line.  You would expect the first click to create 2 arcs.  Circles behave exactly the same way, they split on the first click to create 2 lines.  They have just been obscuring where their beginning and ending point was unless you had viewed their edit sketch.

So to get the behavior you want you have to make the first click reposition the beginning of the circle to the location clicked, then the second click can split it at another position.  So the piece of the circle that is originally the beginning segment of the circle has to first split, then merge the end of the second piece (Arc2 at the unwanted break point) to the beginning of the first piece (Arc1 at the unwanted break point) so it continues to be a single circular line.  Then another click can split the circle elsewhere.  Some method of distinguishing a click that repositions the circle starting point from a click that splits the circle should be made.
0 Kudos