sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Can I override the basic functionality of pushpull?

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 4 Posters 425 Views 4 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.
    • B Offline
      bobdiya
      last edited by

      I'm new to plugin dev and I've created a tool - plytool - seeing some examples.

      This tool allows you to use it like a rectangle tool, but instead of creating a face it will create a cuboid (a ply). If you had to do it using the basic tools you would (1) create a face (2) pushpull it to certain thickness. So now, you could simply do it in one step using the plytool.

      What I'd like to do?
      I'd like to restrict the user on using the pushpull tool only on some faces of the cuboid created using the tool.

      Question
      Can I override the functionality of pushpull to do that? If yes, can you point me to some help examples. If no, it would help if you could suggest me an alternative.

      Thanks

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        I'm afraid that you cannot override or subclass the existing tools. You would have the create all the functionality in your own custom tool.

        http://www.sketchup.com/intl/en/developer/docs/ourdoc/tool.php

        1 Reply Last reply Reply Quote 0
        • TIGT Online
          TIG Moderator
          last edited by

          From what you've said you don't actually want to stop the user having the PlushPull tool available to them ?
          If you do then you could write an initially loaded Tools observer that always flips to Select when PushPull is chosen ?

          BUT to do what I think you want to do WITHIN your own Tool is very possible...
          Like draw a rectangular face and then pushpull it an amount.
          Limiting the user's choice within your tool of available faces for this pushpulling is a matter of testing a face for its suitability - this can be whatever you want - orientation of face.normal [e.g. only 'up' faces], or faces using a particular material or layer ?
          That way your own pushpull tool will simply work in limited ways...

          Perhaps if you explained your code/steps more concisely we could help you advance your ideas...

          TIG

          1 Reply Last reply Reply Quote 0
          • BoxB Offline
            Box
            last edited by

            Sounds pretty much like the thickening feature of Joint Push Pull.

            1 Reply Last reply Reply Quote 0
            • B Offline
              bobdiya
              last edited by

              Apologies for the delayed response.

              Here is how a user would use the Plytool (the tool that creates a box/ply)

              1. Click on the tool icon. Now click (to mark the first point) and start drawing the ply
                1.png
              2. Stop at another point (which is the second point). Leg go the left click and you have your ply
                2.png

              Coming to the questions

              @tig said:

              From what you've said you don't actually want to stop the user having the PlushPull tool available to them ?

              Correct. I don't want to stop the user from using Push/pull but just restrict the user from pushing or pulling on certain kind of faces [e.g - vertical faces only].

              @tig said:

              Limiting the user's choice within your tool of available faces for this pushpulling is a matter of testing a face for its suitability - this can be whatever you want - orientation of face.normal [e.g. only 'up' faces], or faces using a particular material or layer ?
              That way your own pushpull tool will simply work in limited ways...

              Yes, this seems like the suitable option to try. I will try this and get back if any questions. Ideally I would have preferred the ability to override pushpull tool (thereby not introducing a new limited version of pushpull tool). But this should do for now.

              Thanks guys for helping me out and clarifying what is possible and what not.

              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