Quit Current Tool
-
I'm creating a tool, and there are certain situations where it's inappropriate to use the tool (the user does not have the correct type of component selected). I can display an error message easily enough, but how do I then quit the tool? CB.
-
hm... I've not used it - but maybe
Tools.pop_tool?
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/tools.html#pop_tool -
You could use a validation_proc to enable/disable the Tool button and/or menu. There would not be an opportunity to open a message box - the tool would simple not be available.
-
Yes, validation_proc is the correct solution for me. Don't even start the tool if we're not in the correct state. Thanks, Jim. CB.
-
Best to stop the tool running if the circumstances are wrong.
Assuming that you can select the 'wrong thing' within the tool later...
After your error message...Sketchup.send_action("SelectSelectTool;") return nilshould do it ?
Appropriate if you error message says to select something better / different ?? -
Thanks Tig. My tools are specific to a very specialized group of users (timber framers), so they'll know what should be selected. I think having the tool grayed out on the menu is all I need to do. CB.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement