• Login
sketchucation logo sketchucation
  • Login
๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Ending a tool

Scheduled Pinned Locked Moved Developers' Forum
9 Posts 5 Posters 550 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Qverburg
    last edited by 5 Aug 2009, 13:49

    Hello there ruby scripters,

    Im having difficulties in ending a selfmade tool.
    I would like that the tool returns to the last selected tool after finishing a list of methods.
    It is not really an option for me to rescript the tool to a method.

    Another problem for me is getting to start the list of methods only when 1 component instance (or 1 selection even) is selected, when no of multiple instances are selected it should prompt you to select one instance.
    my code is something like this:

    if $selectie.single_object? == false
    UI.beep
    UI.messagebox("please select only 1 ")
    Sketchup.active_model.selection.clear
    else
    method1
    method2
    end

    But now if not 1 instance is selected it keeps hanging in the tool. How do i fix it to wait untill one thing is clicked and then execute the methods?

    Kind regards,
    Quintus

    1 Reply Last reply Reply Quote 0
    • Q Offline
      Qverburg
      last edited by 7 Aug 2009, 19:19

      Solved it with a Sketchup.send_action("selectSelectionTool:").

      1 Reply Last reply Reply Quote 0
      • C Offline
        Chris Fullmer
        last edited by 7 Aug 2009, 19:22

        Excellent, glad you got it working. It sounded like you were looking for something much complicated than activating the selection tool.

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 7 Aug 2009, 21:21

          @qverburg said:

          Solved it with a Sketchup.send_action("selectSelectionTool:").

          I end most of my complex tools with that....

          TIG

          1 Reply Last reply Reply Quote 0
          • A Offline
            AdamB
            last edited by 8 Aug 2009, 06:09

            @tig said:

            @qverburg said:

            Solved it with a Sketchup.send_action("selectSelectionTool:").

            I end most of my complex tools with that....

            I've always used Sketchup.active_model.tools.pop_tool so it returns to whatever you had before rather than forcing the use of SelectionTool.

            Adam

            Developer of LightUp Click for website

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 8 Aug 2009, 07:38

              @adamb said:

              @tig said:

              @qverburg said:

              Solved it with a Sketchup.send_action("selectSelectionTool:").

              I end most of my complex tools with that....

              I've always used Sketchup.active_model.tools.pop_tool so it returns to whatever you had before rather than forcing the use of SelectionTool.

              Adam

              But a lot of plugins end with you perhaps wanting to select something... or if I for example I have made a group you will want to move then I make it the model.selection and invoke the 'Move' tool...

              TIG

              1 Reply Last reply Reply Quote 0
              • A Offline
                AdamB
                last edited by 8 Aug 2009, 20:57

                @tig said:

                @adamb said:

                @tig said:

                @qverburg said:

                Solved it with a Sketchup.send_action("selectSelectionTool:").

                I end most of my complex tools with that....

                I've always used Sketchup.active_model.tools.pop_tool so it returns to whatever you had before rather than forcing the use of SelectionTool.

                Adam

                But a lot of plugins end with you perhaps wanting to select something... or if I for example I have made a group you will want to move then I make it the model.selection and invoke the 'Move' tool...

                Never ever ever second guess the user. ๐Ÿ˜„

                Developer of LightUp Click for website

                1 Reply Last reply Reply Quote 0
                • Q Offline
                  Qverburg
                  last edited by 10 Aug 2009, 09:14

                  @chris fullmer said:

                  Excellent, glad you got it working. It sounded like you were looking for something much complicated than activating the selection tool.

                  Chris

                  Well at first I wanted it to be more complex indeed. But i found out that i could do what i wanted by ending the tool with that commando.
                  I had tried the pop tool but didnt get it working. But since you have to select something in order to use my tool selectSelectionTool gives the same result ๐Ÿ˜„
                  Thanks for your thoughts though!

                  regards,
                  Quintus

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by 22 Nov 2009, 13:55

                    @adamb said:

                    I've always used Sketchup.active_model.tools.pop_tool so it returns to whatever you had before rather than forcing the use of SelectionTool.
                    Adam

                    Do yo have to use Sketchup.active_model.tools.push_tool to activate the tool then? Because I tried Sketchup.active_model.tools.pop_tool when I had activated the tool using Sketchup.active_model.tools.select_tool - and that did not seem to do anything.

                    Thomas Thomassen โ€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement