How to override deactivate method of linetool(Sketch tool)

I want all the edges present in the active model once user deactivated the LineTool(Sketchup Tool).
Is there a way to override that functionality of this tool?

It is not really clear what you want to achieve… Can you please explain with other words and examples (screenshots…)?

The main function of the tool is to create edges. These edges are present in the model when you exit from the Line tool.

Do you really want to override the main functionality? Or you want to delete that edges what the user created during the session of the Line tool? What is the purpose of this?

Or do you want to prevent the user from exiting the Line tool?

You cannot override the functionality of ANY of the native tools.

The solution for this scenario is a custom Ruby tool only. There is an example Ruby LineTool clone in the official tutorials that you can modify / override for your own use. However be sure to change the toplevel module name to YOUR unique namespace module for your modified tool.

1 Like

What are you planning to use these edges for? Are you planning to replace them with a fence or a wall or some other object?

As Dan says you can’t override parts of native tools, but can implement a new one. A new separate tool often also has benefits for the end user. For instance the statusbar text, the pressed toolbar button and other parts of the UI can better communicate what your tool is drawing, rather than suggesting it is used for lines.