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

    Number of copies and distances established from another DC

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    4 Posts 2 Posters 4.0k Views 2 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.
    • R Offline
      ReynaldoECG
      last edited by

      Hi friends.
      I have a DC called "cube", which I want to control by another DC called "data_entered_by_user".
      The "cube" must be copied as many times as the user enters in "data_entered_by_user". And the copies must be positioned on the Y axis, according to the distances set by the user in "data_entered_by_user".
      I thought the "CONCATENATE" function would do it, but it doesn't work. Is there any way to achieve this?


      component_with_data_entered_by_user.PNG


      cube.png

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

        A guess form information posted:

        have 3 attributes pick up distancey1 to 3, say dy1..dy3, then use choose(smallest(round(copy+1),4),0,dy1,dy2,dy3)
        the smallest keeps it within the choose criteria

        it maybe best to upload your project

        1 Reply Last reply Reply Quote 0
        • R Offline
          ReynaldoECG
          last edited by

          @pcmoor said:

          A guess form information posted:

          have 3 attributes pick up distancey1 to 3, say dy1..dy3, then use choose(smallest(round(copy+1),4),0,dy1,dy2,dy3)
          the smallest keeps it within the choose criteria

          it maybe best to upload your project

          @pcmoor, thank you very much for your help and for your time.

          I'm a newbie, and I learned a lot about the "CHOOSE" function from your example. The result is close to what I want, however, I wonder: What happens when I want to increase the number of copies from the DC controller (and also their positions on the Y axis)?

          Is this possible with DC or should I learn ruby?

          Once again, I thank you very much for helping me.


          dc_practice.skp

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

            Yes definitely learn Ruby

            Currently Dynamic Components are the best and "native" way of placing data and having some control over objects, whether "Live Components" are able to compete or excel will be years away.
            So stick with Dynamic Components and learn how they can be controlled and improved on using Ruby.

            For example the "redraw all" script kindly donated by Dan

            https://forums.sketchup.com/t/redraw-all-dynamic-components/77512/10 might help, or placing a redraw onclick in the cube

            However a clear picture of what you trying to achieve may help me to advise the best method.
            array copies are generally y = copy*(leny+space)

            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