sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Copying along w/ Scale

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    12 Posts 3 Posters 1.9k 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.
    • S Offline
      solarepiphany
      last edited by

      Hey there,

      I've been looking up examples to no avail. I'm trying to understand the logic of ....this 3-D Excel...challenging. Anyway, I'm making something like a dynamic fence. I would like the "top" to copy with a user defined space in between as I scale the entire table. The legs should scale with the component. Can it scale and copy in both the x and y directions? If you could give me some pointers i'd really appreciate it.

      Thanks

      Eric


      DCWorkin.skp

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        ok, so you need to add a Copies attribute to the top component because it will be having copies made. Then say it is 10cm long and you want to copy it end to end. So a new copy every 10cm. If the person scaled the DC to 100cm , you should have 10 total top pieces. The Top component would look like this

        LenY=4 keeps the width at 4cm
        LenZ=2 keeps the height at 2cm
        LenX=10 this keep the top piece locked at 10cm long
        copies=current("LenX"/10)-1 this states that what is scaled "current("LenX" " - 100cm, will create 10 copies. But we need 9 copies (because there is already 1 original) so its -1 at the end to make 9 copies, a total of 10 top pieces.
        X=copy*10 this sets the x position of each copy created. So copy0 (the oroginal) will be at 0, copy1 will be at 10, copy2 will be at 20, etc.

        Does that begin to set you towards you goal?

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          Also, page 449 of the SU users guide pdf has a great step by step tutorial for a fence like this.

          Chris

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • D Offline
            duke
            last edited by

            I'd love to know how to do it so you have a set amount of copies. It requires a recursively greater offset per COPY, and I can't work that out.

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              There is a DC variable called "copy" It is the # of the current copy. So if the DC is generating the 5th copy, then "copy" = 5. So if you want each copy to be offset from the previous by 10, then for the X attribute you have this:

              X=copy*10

              That resolves down to X=5*10 , thus making the X position for the 5th copy to be 50. The 2nd copy will be 20, the 100th copy will be 1000.

              Does that answer the question? Does that make sense?

              Chris

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • D Offline
                duke
                last edited by

                Thanks Chris. I'm slowly getting better at the math involved πŸ˜„ I made a tiling DC today that's central panel does not scale, but the vertical beams do, so it can be whatever size horizontally, but is fixed vertically. Loving these DC's

                1 Reply Last reply Reply Quote 0
                • S Offline
                  solarepiphany
                  last edited by

                  Man, the user guide is great tool. It was kind of hard to find (typing in "Sketchup 7 User Guide" into Google showed no direct links!). I'll study up.

                  E

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    solarepiphany
                    last edited by

                    OK Chris,

                    I was able to follow the example in the User Manual regarding the DC Picket Fence. The part I don't understand is the "==5+COPY*(Fence!Spacing+LenX). I read the above posts about the "Copy" variable...but what is the "5" for? Also, where do we find a list of the predefined variables such as "Copy".

                    Thanks for the guidance,

                    E

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      Page 853 has the most important information on making DC's in my opinion. It describes all the attributes, syntax, mathematical operators, etc. I think it could be even more complete, but its really quite helpful. It will talk about Copies vs. Copy. There really aren't too many variabesl like "copy" though. It might the only one really.

                      Ok, the 5. It is an offset from the main post. So work it through w/o the 5 first and you get the following (this is using 0-3 for "copy" and 2 for the Fence spacing and 4 for the picket width):

                      COPY*(Fence!spacing+LenX)

                      0*(2+4) = 0
                      1*(2+4) = 6
                      2*(2+4) = 12
                      3*(2+4) = 18
                      etc

                      So this is setting each "X" 6 inches away from the previous "X", making a nice fence. But the first x is 0, which is also the "X" position of the fist post. So the +5 adds a 5 inch offset to each picket. THe values actually come out as follows:

                      5
                      11
                      17
                      23

                      So they are all still spaced 6" apart, but they start 5" away from X=0. I hope that makes sense. I included a picket fence model like the one in the example. Play with it. Right now it has the 5+ in there. Take it out and see what that does.

                      Then if you want to get crazy, try and add another post that always sticks itself to the other end of the fence and puts itself in the right place based on the copies and spacing of pickets.

                      Hope that helps,

                      Chris


                      picket fence.skp

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        solarepiphany
                        last edited by

                        If they arent yet.....geometry and algebra teachers should be using this tool NOW! SU will bring soooo many visual learners into an appreciation for mathmatics. You teach well Chris. Thanks.

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          solarepiphany
                          last edited by

                          Allright..startin off the new year neck deep in DC's!! Heres a question in line with copying subcomponents within a DC using this fence model... Is there a way to user-define different types of "pickets" within a DC using the component options dialog? Hidden layers? How does the component options "pick" them or switch their layer "on".

                          Any Help is Greatly Appreciated.

                          THanks

                          1 Reply Last reply Reply Quote 0
                          • Chris FullmerC Offline
                            Chris Fullmer
                            last edited by

                            The way to do that is to make a component of each type of picket. Then they each need a hidden attribute asigned to turn them on or off. Then make add a user defined variable to the outermost fence component. Set it as "Users can select from list". Then it will give you a list that you create. Add a name for each type of picket. Lets say there are 3 picket types. Put them in the list like this:

                            Plain - 0
                            Rounded - 1
                            Ornate - 2

                            So now the user will see the name and can select what type of picket they want, and the menu will return a 1,2 or 3 as its value.

                            So now you have 3 separate picket components and a menu option for people to choose what type of picket they want. Now you need to hide all components that are not selected. Do this in the hidden attribute. (I need to mention that we'll use "PicketType" as the user defined variable that creates the menu item that the user selects).

                            Picket 0 should look like this:
                            Hidden - if("PicketType"=0,0,1)

                            Picket 1 should look like this:
                            Hidden - if("PicketType"=1,0,1)

                            Picket 2 should look like this:
                            Hidden - if("PicketType"=2,0,1)

                            That will set each picket component to be visible if the user has selected it from the list. If it is not selected, then it will be invisible. This will be set to all copies of pickets too (I hope).

                            So give that a shot, let me know if it doesn't work like I think it should,

                            Chris

                            Lately you've been tan, suspicious for the winter.
                            All my Plugins I've written

                            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