[CONNECT .NET] DgnTool tool name

How do I set the tool name of a primitive tool that ultimately inherits from DgnTool?  The tool name is useful, for example, because it appears in the Undo/Redo edit menu.

Perversely, there's DgnTool.GetToolName, but no method that I see that implements SetToolName.

Parents Reply
  • fwiw the code will most likely be based on overriding _PopulateToolSettings

    I'm sure you're right.  However, a MicroStationAPI tool doesn't really need to use that call.  The native framework knows to load the Tool Settings dialog with an item list identified by the tool's command ID.

    I am not sure if the below question is same as yours?
    MessageCenter.Instance.StatusCommand = "My Cmd";

    No: that fixes the symptom but not the underlying problem.  Consider the VBA CommandState.CommandName read/write property.  It tells the primitive state engine to use that name when referring to the current command.  That's how the command name is entered into the undo/redo buffer queue.

     
    Regards, Jon Summers
    LA Solutions

Children
  • No: that fixes the symptom but not the underlying problem.  Consider the VBA CommandState.CommandName read/write property.  It tells the primitive state engine to use that name when referring to the current command.  That's how the command name is entered into the under buffer queue.

    How about overriding GetToolName() method in DgnTool class?

       class DgnToolDemo : DgnElementSetTool
        {
            protected override string GetToolName()
            {
                return "MyTool";
            }
            public override StatusInt OnElementModify(Element element)
            {
                return StatusInt.Error;
            }
            ...
        }