sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Hidden function in DC

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    5 Posts 3 Posters 1.2k 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.
    • P Offline
      probuild
      last edited by

      hello guys, I am new to DC, spend all day to make a kitchen cabinet, which changes in sizes length height and depth, with success,
      in component option window I want the user to have a text box with the option to hide the door of the cabinet box or not
      in the component attributes window I succeeded with this on the child component level (behaviors hidden), but how do I transfer this to the parent component level, so the user can choose the option in a text box in the component attribute window
      has anyone already done this? and is it possible to have it in the attribute onClick also
      can I combine the two?

      resume what I want,
      when opening component options window:
      the user can choose from a txt box, length, height and depth of the cabinet (this I have)
      but I want an extra text box where he can choose door hidden or not
      and if possible together, if he clicks on the door it disappears or reappears

      thanks in advance and sorry if these questions are to simple for you guys

      regards,
      guy

      1 Reply Last reply Reply Quote 0
      • jeff hammondJ Offline
        jeff hammond
        last edited by

        @probuild said:

        but how do I transfer this to the parent component level, so the user can choose the option in a text box in the component attribute window

        you should do it the other way.. put the choice in the parent level then pass is down to the child with =parent!(attribute)

        here's a quickie example.. the parent accepts the depth & visibility then passes the info down to the respective child.

        dc_parent_example.skp

        dotdotdot

        1 Reply Last reply Reply Quote 0
        • P Offline
          probuild
          last edited by

          tx very much Jeff for your quick reply and for the effort to make an example
          what about the onClick?
          I encountered also a problem this morning when I opened my saved component which I made yesterday
          the parent component was gone and it opened as separate components, I saved it yesterday with save as (on the right click)
          what did I do wrong?

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            In this case, you should File > import the model rather than File > open it. (You can also drag&drop the model from your file browser into SketchUp.)

            Typically, I do all the DC work on a "working copy" of a DC. Then when it is ready to use, that is when I export the Component using the right-click Save as option.

            Hi

            1 Reply Last reply Reply Quote 0
            • jeff hammondJ Offline
              jeff hammond
              last edited by

              @probuild said:

              what about the onClick?

              yeah, you can do that too using SET()
              in this case, i just added an onClick behavior to the parent then entered Set("door_vis",0,1)

              (and if you prefer, you can use TRUE or FALSE instead of 0 and 1)

              so now, in this example, the door can be hidden via the Component Options window's dropdown list OR with the onClick

              dc_parEx_withOnClick.skp

              dotdotdot

              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