I need a ROUNDUP function

I need a ROUNDUP function

Postby twdant » Tue Apr 29, 2014 8:26 pm

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:



0
Last edited by twdant on Tue Apr 29, 2014 8:35 pm, edited 1 time in total.

twdant 
 

Re: I need a ROUNDUP function

Postby eneroth3 » Tue Apr 29, 2014 8:33 pm

Isn't there a Ceil function?
0
User avatar
eneroth3 
PluginStore Author
PluginStore Author
 

Re: I need a ROUNDUP function

Postby twdant » Tue Apr 29, 2014 8:36 pm

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.
0

twdant 
 

Re: I need a ROUNDUP function

Postby Jim » Tue Apr 29, 2014 9:22 pm

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.
0
Hi

Jim 
Global Moderator
 

Re: I need a ROUNDUP function

Postby twdant » Wed Apr 30, 2014 2:08 pm

Jim, I could kiss you.
0

twdant 
 

Re: I need a ROUNDUP function

Postby Jim » Thu May 01, 2014 9:15 pm

twdant wrote:Jim, I could kiss you.


You're welcome. Are you making any progress?
0
Hi

Jim 
Global Moderator
 

Re: I need a ROUNDUP function

Postby twdant » Fri May 02, 2014 1:27 pm

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.
0

twdant 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Dynamic Components

Who is online

Users browsing this forum: No registered users and 1 guest

Visit our sponsors: