• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

I need a ROUNDUP function

Scheduled Pinned Locked Moved Dynamic Components
sketchup
7 Posts 3 Posters 1.6k Views
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.
  • T Offline
    twdant
    last edited by twdant 29 Apr 2014, 19:26

    I'm designing a linear building foundation that needs to space studs equally along the length at no greater than 5' on center. I've got it worked out for lengths divisible by 5', but at certain lengths I can't make it work out evenly. The hangup is in the "Copies" bit of my stud attributes. For example, when I try a 16' length, my copies formula outputs 3.2, and I need it to be 4. That would be easy if I had access to a roundup function, but it seems none exists. So I tried to workaround by changing the formula to "=1+FLOOR(rail!LenY/60,0)" where "rail" is the floorplate. In this case, the input for "rail!LenY" is 192" (16 feet). I know that 1+FLOOR(192/60) is 4, but for some reason when I view the plain data output of the "Copies" attribute, it says "1".

    My parent component has a custom attribute called "spacing" to determine the y position of the studs. That formula is "=(rail!LenY/leg!copies)-2.25", where "rail is the floorplate, "leg" is the stud, and 2.25 is the thickness of the stud (I'm measuring 5' on center, and the spacing is asking for inside to inside measurements).

    Now, the truly baffling part: The end goal is to save the component as a 1' section of floorplate to make it easy to scale (i.e., 1' scaled to 20 equals a 20' floorplate; 1' scaled to 68 equals a 68' floorplate). If I scale the 1' section to 16' with the "Copies" attribute blank, then insert the formula above, it works perfectly. What gives? Screenshots below:


    http://i821.photobucket.com/albums/zz135/twdant/floor1_zps25669956.png


    http://i821.photobucket.com/albums/zz135/twdant/floor2_zpsde390c03.png


    baserailwip.skp

    1 Reply Last reply Reply Quote 0
    • E Offline
      eneroth3
      last edited by 29 Apr 2014, 19:33

      Isn't there a Ceil function?

      My website: http://julia-christina-eneroth.se/

      1 Reply Last reply Reply Quote 0
      • T Offline
        twdant
        last edited by 29 Apr 2014, 19:36

        If I use the ceiling function on the 1' piece, it ouputs "1" when I lengthen the component to 16'. If I leave the formula blank, lengthen it, then input the ceiling formula, it works.

        I guess the problem isn't so much with the formula as it is with the timing. Any time I input a correct formula on the 1' piece, it doesn't work on any length not divisible by 60".

        EDIT: I think this problem is like an evolving virus.

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 29 Apr 2014, 20:22

          i think one thing that is going on is you have 2 formulas that rely on the COPIES attribute - one in the parent and one in the child. The Parent formula does not get updated until the next "refresh" of the component since it has already completed it's calculation before the COPIES in the child attribute is udated.

          Move the "spacing" attribute from the parent to the leg component and see if things start behaving better. Don't forget to change the leg:Y formula to use the "spacing" from leg instead of baserail!spacing.

          Hi

          1 Reply Last reply Reply Quote 0
          • T Offline
            twdant
            last edited by 30 Apr 2014, 13:08

            Jim, I could kiss you.

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by 1 May 2014, 20:15

              @twdant said:

              Jim, I could kiss you.

              You're welcome. Are you making any progress?

              Hi

              1 Reply Last reply Reply Quote 0
              • T Offline
                twdant
                last edited by 2 May 2014, 12:27

                Absolutely. That problem is fixed and I've moved on to another problem with a different component. If you get a chance, take a look at my "Help close the gap" thread. I'd sure appreciate any help you might be able to offer.

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

                Advertisement