I am having multiple pieces of connected lines available. Now I want to draw a new line (a portion from the connected small lines) exactly on top of connected lines by using mouse. The placement process should follow below steps.
1. click the start point on one of the connected lines
2. Drag the mouse along with the connected lines till you reach the required end point
3. click the end point on one of the connected lines
4. A new line should be drawn from start point to end point by following the mouse trace.
Any existing functionality or C# code will be helpful.
I am having multiple pieces of connected lines available. Now I want to draw a new line (a portion from the connected small lines) exactly on top of connected lines by using mouse. The placement process should follow below steps.
1. click the start point on one of the connected lines
2. Drag the mouse along with the connected lines till you reach the required end point
3. click the end point on one of the connected lines
4. A new line should be drawn from start point to end point by following the mouse trace.
Any existing functionality or C# code will be helpful.
I have an article posted years ago about trace a single polyline with mouse move:
https://drive-cad-with-code.blogspot.com/2014/09/moving-mouse-cursor-to-trace-polyline.html
Sorry for the video clip in the article not working because of modern browser no longer support flash video. But the code is actually rather easy to read/follow for you to get an idea.
Of course, you need to add extra code to extend the tracing drawable for the Transient Graphic for multiple connected curve (polyline, or line) and handle the situation of how they connected: end-to-end, one-cross-the-other, end-to-middle (branch).... The code would get complicated quickly as you can see.
Norman Yuan
I have an article posted years ago about trace a single polyline with mouse move:
https://drive-cad-with-code.blogspot.com/2014/09/moving-mouse-cursor-to-trace-polyline.html
Sorry for the video clip in the article not working because of modern browser no longer support flash video. But the code is actually rather easy to read/follow for you to get an idea.
Of course, you need to add extra code to extend the tracing drawable for the Transient Graphic for multiple connected curve (polyline, or line) and handle the situation of how they connected: end-to-end, one-cross-the-other, end-to-middle (branch).... The code would get complicated quickly as you can see.
Norman Yuan
Can't find what you're looking for? Ask the community or share your knowledge.