• Login
sketchucation logo sketchucation
  • Login
Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

User input controlling sub-sub-components within a DC?

Scheduled Pinned Locked Moved Dynamic Components
sketchup
4 Posts 3 Posters 1.4k Views 3 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.
  • D Offline
    danbig
    last edited by 12 Jul 2010, 07:21

    Hi -

    Is it possible to set a user input box on a DC to control sub or sub-sub components within that DC?

    I have to admit, I haven't searched extensively for a way to do this, but the answer isn't clear to me based on the little DC work I've done.

    I've watched the "repeat" DC tutorial, where a fence is scaled at the sub-component (fence slat) is repeated.

    I'd like to do something like that, but also control the rotating of the sub-component.

    Imagine that I want to create a dynamic component, which has a fence rail, and fence slats. I want the fence slats to repeat on a set spacing, and I want the user to control the rotating of the fence slat about one of the fence rails.

    Was I clear enough that someone could comment?

    1 Reply Last reply Reply Quote 0
    • J Offline
      Jim
      last edited by 12 Jul 2010, 12:15

      Dan,

      It can be done, buy it is not as straight-forward as it could be.

      One option is to assign the attribute directly to the nested component. The user would then need to open the top-level DC for editing until the target component is selected, and then open the DC Options dialog.

      The other option is to assign an attribute to the top-level component, and pass the value down. The main constraint is that a component can only access direct parent and child attributes. So if you need to set an attribute in a grand-child component, you need to use a intermediate attribute in the child.

      
      - TopLevel
        |
        + Child
          |
          + GrandChild
      
      

      If you need an attribute "foo" in GrandChild, you start with a "foo" in the TopLevel:

      TopLevel!foo:(get value from dialog.)

      Pass it to the first Child"

      Child!foo: =parent!foo (or =TopLevel!foo)

      And finally down to the GrandChild:

      GrandChild!foo: =parent!foo (or =Child!foo)

      if that makes sense.

      Note 1: The name of the attribute is not required to be the same - it just seems to make sense to use the same attribute name in all 3 levels.

      Note 2: Not sure of the =parent!attribute form is documented anywhere, but using =parent can provide a small amount of abstract re-use for DC's.

      Hi

      1 Reply Last reply Reply Quote 0
      • H Offline
        Howard leslie
        last edited by 12 Jul 2010, 13:06

        Dan,
        See this, A question I've asked before:
        http://forums.sketchucation.com/viewtopic.php?f=289&t=23202
        ........
        It appears that you can't reference nested components directly (unfortunately)
        .........
        Hope this clears things up
        Bye
        Howard L'

        1 Reply Last reply Reply Quote 0
        • D Offline
          danbig
          last edited by 16 Jul 2010, 06:31

          Thanks, all. This is exactly what I needed.

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

          Advertisement