Custom rectangle tool

Discussion created by thib on May 4, 2011

I have some question regarding the development of custom tool for creating new feature:

I have to create several custom drawing tool to easily create features. The development should be compatible with the version 9.3 because my client are still using it. At the same time, I would like to develop it so that the update to the version 10 remains as easy as possible. I need your help to confirm that the way I am planning to do it is the right one.

Let me explain a bit one of the tools:

It consists in creating am orientated rectangle feature. It will be similar to the rectangle tool except that three points are need in order to determine the rotation angle:
- the first click gives the first corner point
- the second click gives the orientation of the base side
- the third click gives the position of the opposite corner
when two of the points have been entered, I would like to create a feedback to preview the final rectangle.

As mentionned in:

Some construction tools, such as the Rectangle and Circle tools, do not use the shape constructors. These tools handle the feedback and geometry within the tool itself. Implementing the indicator interface IShapeConstructionTool determines if the shape constructors are used. Do not implement this interface if you will handle the geometry creation in your tool. In this case, you need to create a regular ITool or BaseTool component, as previously described, and handle the tool events yourself to create the geometry and feedback.
(anyway, shape constructors don't exist in 9.3 :))

so what I am planning to do is to create the tool and use a feedback object in the OnMouseDown, OnMouseMove functions. (following the example At the end I will add the geometry to the sketch and finish the sketch to trigger the feature storing.

Regarding the feedback, I may use the NewPolygonFeedback co-class but it may complicated. Do you think I should better create my own feedback class for this geometry? In this case, I didn't find any example of how to do it (in particular, the drawing, refresh, etc.).

Please tell me if it is the right method (for ArcObjects 9.3) and if you have any advice for the feedback issue.
Thank you for your help,