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

Use of tools within tools?

Scheduled Pinned Locked Moved Plugins
18 Posts 6 Posters 2.3k Views 6 Watching
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.
  • J Offline
    jeff hammond
    last edited by 10 May 2010, 01:29

    @kwalkerman said:

    Say, use select to have the user select a bunch of objects, and on return, use move to let the user move them, then on return, use another tool to let the user do something else?

    maybe i'm missing something but if that's the example then you can already do exactly that.
    what's the problem you're having doing these steps with the standard tools?

    [edit] well, you don't use the return key but...

    dotdotdot

    1 Reply Last reply Reply Quote 0
    • K Offline
      kwalkerman
      last edited by 10 May 2010, 02:32

      The problem is that there are certain things I do all the time, in the same order, and I want to make it faster.

      Right now, I'm trying to create a "Slippery Move" tool, where you can move things without having them stick, or have them stick only to selected objects. The sequence for the basic Slippery Move is to select some things, make a group out of them, move the group, and then explode the group. The sequence for selected Slippery Move is to select some objects to move, then select which things you want it to stick to. The tool will make a group out of the "slippery" objects, allow the user to move the objects selected for the move, and then explode the group.

      For obvious reasons, being able to say "use select tool until... (enter or keystroke)" or "use move tool until... (enter or keystroke)" would be extremely useful in this situation. I really want to have all the functionality of the built-in select and move tools so that the Slippery Move tool operates in ways that the user expects. Having to re-create all that functionality seems ridiculous.

      1 Reply Last reply Reply Quote 0
      • C Offline
        Chris Fullmer
        last edited by 10 May 2010, 03:13

        There is no reason you can't do this (to some degree).

        Just make your tool and have it remember what state it is at when the user exits to switch over to the select tool. Then when the user switches back to your tool, it should remember what steps have already been done. I think the hardest thing is going to be the move tool. Since you are looking for functionailty that is not a part of the move tool, you obviously will not be able to use the built in move tool. That you will have to write from scratch.

        I think you would be better off to just write it all from scratch though. Making a select tool is not terribly hard. I wrote an example for August a couple of days ago in just a couple of linesa of code that draws a line to whatever is clicked on. So the select tool is returning the x,y,z position from wherever the mouse is. It is not much different to have it return an object id. Then your tool would store an array of objects to move. And an array of objects to stick to. Then you have the fun of writing the move tool. I don't think I've ever written something that moves objects in real time with the mouse. So that would is new territory for me, but I'm sure you can figure it out!

        Chris

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

        1 Reply Last reply Reply Quote 0
        • J Offline
          jeff hammond
          last edited by 10 May 2010, 03:21

          @kwalkerman said:

          The problem is that there are certain things I do all the time, in the same order, and I want to make it faster.

          Right now, I'm trying to create a "Slippery Move" tool, where you can move things without having them stick, or have them stick only to selected objects. The sequence for the basic Slippery Move is to select some things, make a group out of them, move the group, and then explode the group. The sequence for selected Slippery Move is to select some objects to move, then select which things you want it to stick to. The tool will make a group out of the "slippery" objects, allow the user to move the objects selected for the move, and then explode the group.

          For obvious reasons, being able to say "use select tool until... (enter or keystroke)" or "use move tool until... (enter or keystroke)" would be extremely useful in this situation. I really want to have all the functionality of the built-in select and move tools so that the Slippery Move tool operates in ways that the user expects. Having to re-create all that functionality seems ridiculous.

          i sort of get where you're coming from but i also suspect you don't use shortcuts. with shortcut keys, that exact operation is nothing.. even if you have to do it a lot.
          the most time consuming part of that whole thing is selecting the multiple objects (especially if you're talking a bunch of littler lines and/or faces).. a select tool plugin that would select exactly what i want -- now that would be a winner πŸ˜„

          another thing you might try is drawing in groups/components to begin with.. maybe foresee the geometry you're going to move later and make sure to draw that in it's own group.. another benefit of doing it like that is you will somewhat get the functionality you're asking for with the select tool except it will be with the move tool.. the move tool can select a group and you can also use it to rotate. in other words, if you're working with groups, is actually

          i dunno, just some ideas and maybe i'm not seeing the real possibilities here.

          [edit] i might of missed part of your post implying that you would like to create the plugin? go for it! i think these guys that are already in the thread will help you out along the way.
          i'll surely try it out when you're finished

          [edit2] or, maybe i'll wake up in the morning and see that chris already wrote it last night πŸ€“ πŸ˜„

          dotdotdot

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 10 May 2010, 10:19

            To make a 'move tool' you simply transform! the selection to match the cursor position as you move and when you finally click it's frozen... The selection appears on the end of the cursor as you move it...

            TIG

            1 Reply Last reply Reply Quote 0
            • T Offline
              thomthom
              last edited by 10 May 2010, 10:30

              @kwalkerman said:

              Right now, I'm trying to create a "Slippery Move" tool, where you can move things without having them stick, or have them stick only to selected objects. The sequence for the basic Slippery Move is to select some things, make a group out of them, move the group, and then explode the group. The sequence for selected Slippery Move is to select some objects to move, then select which things you want it to stick to. The tool will make a group out of the "slippery" objects, allow the user to move the objects selected for the move, and then explode the group.

              I'm just wondering, why not just keep the object you don't want to "stick" (merge with other geometry?) grouped? You say it's something you often do - trying to prevent geometry from merging?
              What kind of models are you making?

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

              1 Reply Last reply Reply Quote 0
              • K Offline
                kwalkerman
                last edited by 10 May 2010, 14:13

                1. I use shortcuts, all the time. The idea is that the tool would take care of some of the stuff automatically, and then give you the next tool you need, taking fewer keystrokes.

                2. I generally use the program for architecture, currently I'm designing a post and beam barn. I often find myself copying lines, and deleting the original (another way to accomplish a "slippery move"), especially when creating the roof geometry with dormers, etc. This is partly because I'm stubborn and I like my walls and roofs to be thick, ie have two sides.

                3. I'm learning to program ruby, and I figured this would be an "easy" first plugin I could create in order to facilitate learning (and that would be useful later on). Am I really the only one who thinks being able to call tools within tools would be useful?

                4. I thought that calling an already existing tool would be the easiest way to do what I'm looking to do, but I guess I'll need to re-create the move and select tools. Chris - can you send me a link to the sample code you created for August? I'd really appreciate it.

                Thanks for all your help and comments.

                --
                Karen

                1 Reply Last reply Reply Quote 0
                • J Offline
                  jeff hammond
                  last edited by 10 May 2010, 15:51

                  @kwalkerman said:

                  1. I use shortcuts, all the time. The idea is that the tool would take care of some of the stuff automatically, and then give you the next tool you need, taking fewer keystrokes.

                  well, you're suggesting using the return key to change to the next step so there are still keystrokes in there. seems just the same to me to push 'M' to switch to as pushing return.

                  @unknownuser said:

                  1. I generally use the program for architecture, currently I'm designing a post and beam barn. I often find myself copying lines, and deleting the original (another way to accomplish a "slippery move"),

                  cmmd X then cmmd V will do exactly that.. try it.

                  i'm pretty sure i know what you're after here and it's something i used to want as well.. you pretty much just want to move stuff around without it sticking to other geometry?. i guess i've just become used to doing this in a manner that sketchup already allows.

                  dotdotdot

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    jeff hammond
                    last edited by 10 May 2010, 20:08

                    one thing you will probably encounter along the way of making the script is deciding what to do with geometry that is shared by the objects you'd like to move and the ones that you are moving.. this is probably the reason why sketchup doesn't allow this natively because once you start thinking about it, this could cause problems depending on what you're trying to move.

                    i guess the best way to do it would be to have anything that is shared to be duplicated upon moving ❓

                    untitled.jpg

                    dotdotdot

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      kwalkerman
                      last edited by 10 May 2010, 20:34

                      Jeff,

                      yes, this is what happens when you create a block, and then move the block (which is why I chose that method of executing the slippery move). You can also copy something, move the copy and delete the original, which would result in a hole in your yellow box (front face still existing).

                      --
                      Karen

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        jeff hammond
                        last edited by 10 May 2010, 21:44

                        is this possible with ruby?

                        1. make your selections with the standard select tool..

                        2. activate the plugin which immediately groups the selection then switches to the move tool.. upon moving/placing the newly created group, it explodes?

                        i'm suggesting using the standard select tool instead of making that part of the slippery slide because it may simplify the coding while not adding any additional steps to the operation (because you'll still have to tell SU when your selection is complete.. might as well just do the selection using then activate the plugin)

                        dotdotdot

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          thomthom
                          last edited by 10 May 2010, 21:49

                          @unknownuser said:

                          1. activate the plugin which immediately groups the selection then switches to the move tool.. upon moving/placing the newly created group, it explodes?

                          Yes - by using the ToolsObserver http://code.google.com/apis/sketchup/docs/ourdoc/toolsobserver.html you can detect Tool activity. Though you need to find out what state in the tool to look for.

                          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
                          1 / 1
                          • First post
                            16/18
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement