Back to All Channels

Help with Formulas

Hi there,


I've watched a bunch of tutorials and read the transversal logic operators. But I'm pretty new to formula creation and hoping someone can help me.


I'm looking to create a formula for lighting track components. It essentially comes in 3ft (1M) and 6ft (2M) sections (sometimes in 9ft - 3M sections) and then has components like feeds and joiners. For the track itself, I got somewhere with a series of conditions "if the track is under 3ft, use a 1M track" "if it's between 3 and 6 ft use a 2M track" "if it's between 6ft and 9ft use a 2M + a 1M track" etc etc. I'm wondering if there's a way to write simpler logic so I don't have to write a formula for every size possibility up to 100+ ft. Is there a formula that would say "for every 6ft use a 2M track and if the remainder is greater than 3ft add a 1M track"?


Thank you in advance! Had a bit of smoke coming out of my ears trying to figure it out.

I'll see if I can come up for a formula for this for you. I know there's a lot of new functionality on formulas with the release from a couple days ago; may be able to do it without needing a giant formula.

👀2

i asked chat gpt to write one as Zztakeoff uses math.js (whatever that is it was a important prompt)


go try it! Here is my results

👍2❤️1

Here's a formula for you to use that I believe I got to work.

You'll need to set up a linear takeoff with two separate material items like this:


The formula for 3' Track material item needs to be this:

[Linear:FT] <= 3 ? 1 : ([Linear:FT] > 3 && [Linear:FT] <= 6 ? 0 : ([Linear:FT] % 6 > 0 && [Linear:FT] % 6 <= 3 ? 1 : 0))


The formula for 6' Track material item needs to be this:

[Linear:FT] <= 3 ? 0 : ([Linear:FT] > 3 && [Linear:FT] <= 6 ? 1 : (floor([Linear:FT] / 6) + ([Linear:FT] % 6 > 3 ? 1 : 0)))


I tested it and dragged out the linear and it seemed to work correctly. Let me know if it doesn't.

👍1👏1🔥2

Wow! Thank you both! Just...wow.

🙂1

Hello! Me again. I've been testing out these formulas and extrapolating. The issue I'm running into is that this formula calculates based on the TOTAL linear feet of a takeoff type and not each segment of linear of that type. For instance, if I have a 3ft run and a 6ft run and a 9ft run, the result will tell me to just get 2 x 9ft runs of track, rather than 1 each of a 3/6/9ft. Any thoughts? Is there a way to apply formulas to singular instances rather than an overall total?

As a workaround try using the same formula in the segment tool

Gillian -- from what I understand, they will be coming out with a Beam Tool soon. The Beam Tool is what you want here. When it rolls out, shoot me a message and I'd be happy to dig into it.

🙏1
You must be logged in to post replies. If you don't have an account you can signup here.