Creating Nested/Complex Dynamic Components?


#1

Hi there,
First, I am completely new not only to this forum but online forums in general, so please redirect me if I am posting the wrong thing in the wrong place or somehow otherwise unintentionally wreaking havoc.

I just recently started working on creating my own dynamic components and have been experiencing issues with a design I made for a folding attic access ladder. Here is a picture of the model (the part on the right):


It has three parts: The main backing piece that holds the ladder and folds down from the ceiling, the middle section of ladder, and the bottom bit with the rest of the rungs. I have no problem making it work with two pieces, but when I add the third one, things get strange. My goal is to make the ladder fold down from the ceiling and extend with one click so it looks like the part in the left of the picture above.

So far, I can’t think of any way to make it work without nesting the components inside of each other. When I nest the components, things get strange. For example, I got all of the bits and pieces working with the following (which to my mind should make the whole assembly pivot down 60 degrees, and then each of the two ladder sections rotate 180 degrees so as to extend down):

      MAIN LADDER PIECE
      RotX:    =MainRot
      MainRot:    60
      onClick:     ANIMATE("MainRot",0,60); ANIMATE("LADDER MIDSECTION!MidRot",0,180)

                LADDER MIDSECTION
                RotX:      =MidRot
                MidRot:    180

                          LADDER BOTTOM
                          RotX:    =LADDER MIDSECTION!MidRot

However, when I use this configuration, although it works, the model stretches lengthwise and becomes much thinner when I activate it. When I activate it again, to “close” the attic ladder, it once again works, but becomes dramatically thick, and continues to become thicker each time it is activated thereafter. I don’t understand what I’m doing wrong. Is this something that is even possible with dynamic components? Is there a rule of creating them I should be aware of that I’m accidentally breaking?

Thanks in advance!

~ Aiden

P.S. Here is the file if that is helpful: Attic Ladder.skp (287.1 KB)


Multiple Animation Dynamic Components
#2

DCs only seem to work reliably when you have two levels (parent and child).


#3

I changed the formula so there only one animate action, added a smallest formula to the first rotation to keep at 60 degrees

Attic Ladder (2).skp (287.7 KB)

multiple rotation via separate animation can cause size and position issues, ( this is due to sketchup updating the geometry between events) that can be resolved using fixed values or using an isolating wrapper, but the formula change is easier


#4

Got it. Thanks!


#5

Thank you for your reply and taking the time to upload a working version so I can learn from the example! It really helps me to be able to see the working thing in action and then look at what is going on behind the scenes to better understand what goes into making it function.

~ Aiden


#6

Not levels per se, but a one-to-many relationship. Nested components can easily get attributes from their Parents, but not vice versa.
A Parent can have many children, but a child can have only one Parent (not in real life:)


#7

Just in case anyone is interested, I created a more detailed version and uploaded it to the warehouse here.

Thanks again for the help!
~ Aiden


#8

I’d suggest a (conceptually) small change:

  1. Change your outermost group into a Component
  2. Put your “OnClick” attribute and the custom variable it animates into it instead of 1 level down
  3. Adjust variable references to get it working again.

Why? With the click tool activated, it works almost everywhere except the immovable frame. With the suggested change, your component should animate no matter where you click.


#9

I think that is intended and I think it’s fine. Ultimately, the interact should only apply on the string (and making a pull-down-movement)


#10

While I haven’t done it often (create a clickable dynamic component), those times I have I’ve strived to make it as easy as possible to find an appropriate spot. In this case, if the dynamic hand tool to initiate action is active, I think it’s reasonable allow clicks anywhere near the moving pieces - as long as you don’t need a different action to occur based on an adjacent area.

As far as this ladder is concerned, without my suggestion you can experience pointing at the assemble with no response as follows: When folded, you can click above the frame, and on the string below the frame, but not on the frame. This creates a discontinuity.


#11

As a kid, I once fell down wile standing above the supossedly closed frame… this topic brings to much memories


#12

Thanks for the suggestion!
I decided to leave it like it is because my goal was to be able to install it in the ceiling of a garage I’m modeling and then click on the underside of the door to activate the component from underneath (the frame will be behind the drywall in the ceiling).
That said, I appreciate the advice and will hopefully incorporate your suggestions in future projects.

Yikes! Please don’t try that again… the one in my garage is installed with a 12’ ceiling over a cement floor so I’ve always been terrified of falling off.

Also, I think I finally finished the model to an extent that I’m satisfied with. I added the mechanism with the springs and arms for extending and retracting the ladder as well as a timeline so that a longer ladder can be introduced without worrying about it intersecting the frame when extending/retracting. The whole finished thing can be found here. The mechanism isn’t perfectly accurate and there are probably more efficient ways of going about the same thing, but I’m still quite pleased I got it working (it was my first venture into creating dynamic components) - thanks all for the help!


#13

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.