sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Sliding door with rotating handle

    scheduled pinned locked moved Dynamic Components
    sketchup
    8 Posts 2 Posters 1.6k Views 2 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • J Offline
      jharchar
      last edited by

      I'm trying to create a sliding door that moves on click and also have the door handle rotate 90 degrees at the same time.
      please post a solution or re-upload sliding door.skp with solution so I can see what you did.

      Thanks in advance πŸ’š


      saved as skp7

      one-reply-to-this-post last-reply-time reply quote 0
      • J Offline
        jharchar
        last edited by

        So i kinda figured it out but i couldn't get the handle to rotate 90 degrees. The rotation seems to be restricted by the x position of door#1.
        so still looking for a better solution. 😐


        skp7 2nd try

        one-reply-to-this-post last-reply-time reply quote 0
        • J Offline
          Jim
          last edited by

          Instead of using the animate function to change the X, you could create a new custom attribute, and then animate that attribute.

          Let's say you add an attribute named movement. Then onClick would animate the movement variable, which is used by both the Door and its child Component (the handle.)

          See image for example;
          1132.png


          SlidingDoor[jf].skp

          Hi

          one-reply-to-this-post last-reply-time reply quote 0
          • J Offline
            jharchar
            last edited by

            I have a question though could you explain further what /100*-36 means in door position x means.

            Thanks for your help

            one-reply-to-this-post last-reply-time reply quote 0
            • J Offline
              Jim
              last edited by

              @jharchar said:

              I have a question though could you explain further what /100*-36 means in door position x means.

              Sure, it means: "divided by 100 times negative 36."

              I am using the movement as a percent. The movement variable goes from 0 to 100, so dividing it by 100 means it goes from 0 to 1. (Note I did move the Axis of the Door so it was also at the origin.

              @jharchar said:

              Thanks for your help

              Y'er welcome.

              Hi

              one-reply-to-this-post last-reply-time reply quote 0
              • J Offline
                jharchar
                last edited by

                that makes perfect sense. is there any way to make it more realistic and have the door handle rotate first and then have the door slide? maybe with some type of animation delay. ❓

                one-reply-to-this-post last-reply-time reply quote 0
                • J Offline
                  Jim
                  last edited by

                  Consecutive animations are harder, unless I'm missing something obvious.

                  What I did is double the movement from 0-100 to 0-200. Then I use IF statements to test if movement is < 100 and movement is > 100, and set m1 & m2 based on the value of movement. Basically, m1 goes from 0 to 100 when movement goes from 0 - 100, and m2 goes from 0 - 100 when movement goes from 100 - 200.

                  This is one way, but I would welcome something cleaner.

                  1133.png

                  Hi

                  one-reply-to-this-post last-reply-time reply quote 0
                  • J Offline
                    Jim
                    last edited by

                    Just a note - you could also have done the concurrent animations by placing 2 (or more) animate functions on the same onClick function, just seprate them using a semi-colon:

                    onClick: animate(X, 0, 36);animate(Handle!RotY, 0 , 90)

                    Hi

                    one-reply-to-this-post last-reply-time 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