How to make FeatureConstructionPointTools.Register and .Unregister work?

516
0
09-04-2012 03:58 PM
SuiHuang
Occasional Contributor II
Hi Everybody:

    I am making a custom shape constructor following the instruction of

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000002nq000000

    and I am starting from checking the example

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/d/00010000014z000000.h...

     In the constructor of this tool, if I add a statement
FeatureConstructionPointTools.Register("PointsAlongLine.PointsAlongLine");

then I can see the tool showing up in the list of Construction Tools for point feature templates in ArcMap editing session. I tried the following and they are not working in the way I expected:

1. I put a FeatureConstructionPointTools.Unregister("PointsAlongLine.PointsAlongLine") statement in the constructor of the sample code instead, but the "Points along a line" construction tool still show up for the point templates in edit session.
2. I put a FeatureConstructionPointTools.Unregister("PointsAlongLine.PointsAlongLine") in some other custom command code and ran it within and outside of edit session, but the "Points along a line" construction tool still show up for the point templates in edit session.
3. I removed the "Points along a line" construction tool using Categories.exe provided by ArcGIS, and then I tried to run FeatureConstructionPointTools.Register("PointsAlongLine.PointsAlongLine") from some custom command to put it back to construction tool list, but it doesn't work.


From the test I only figured out that I can register a tool to the ArcMap construction tool list by puting code in the constructor function of the tool. But I haven't figured out how to:
* unregister the tool from construction tool list
* register the tool from other places such as another custom command.

How can I properly use the FeatureConstructionPointTools class to do register/unregister?

Thank you!
0 Kudos
0 Replies