Is it possible to have a subroutine in MapBasic that will initiate object creation, in same way as if you clicked Spatial->Insert->Polyline for example.

I know I can create custom ToolButton and set DrawMode, but I have C# form and one of button is meant to initiate polygon creation. I have looked deeply in MapBasic Reference and User Guide, but couldn't find anything useful.

1 Answer 1


You will have to add a ToolButton control to the ribbon that has the right properties such as drawmode and cursor.

In your dialog, you can then use SetCurrentCustomTool to activate your tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.