PDA

View Full Version : Schedule Calculations



E-Key
2006-08-01, 08:05 PM
I can't overcome one problem.
I describe the situation in general terms.
Please find in attachment sample project, which has:


Linear family with parameter A,
Square based family with parameters A and B
And Volume based family defined with parameters A,B and C
All parameters are shared ones and I placed them into schedule. Now I want to calculate parameters like this:
Quantity = if(C>0, A*B*C, (if (B>0, A*B, A)))
Units = if(C>0, "m3", (if (B>0, "m2", "m")))

The problem is that these formulas don't work fully.

Any suggesting how to find a solution, will be appreciated.

LRaiz
2006-08-01, 08:37 PM
The way you defined it, Quantity sometimes measures volume, sometimes area, and sometimes length. So you can not even specify the type of a parameter for Quantity. Units on the other hand seems to be simply a text parameter.

You also may be making an assumption that internally volume, area, and length are stored as m3, m2, and m which not the right assumption to make.

Why don't you try to make Quantity a numeric parameter (unit-less) using the formula
Quantity = if(C>0, A*B*C/1.0m3, (if (B>0, A*B/1.0m2, A/1.0m)))

Then I expect that things may start working. Formulas will start measuring Quantity in m3, m2, and m regardless of project units. Then if you have cost values per cubic meter, per quadratic meter, or per linear meter (again as unit-less parameter) you should be able to multiply Quantity by cost and get total rubles (or dollars as the case may be).

E-Key
2006-08-01, 08:46 PM
Why don't you try to make Quantity a numeric parameter (unit-less) using the formula
Quantity = if(C>0, A*B*C/m3, (if (B>0, A*B/m2, A/m)))
Thanks for reply.
In attached to my first note sample project my formula has done exactly like your formula, but it doesn't work properly. You can see the result of calculations on attached picture.

LRaiz
2006-08-01, 09:03 PM
C parameter is not defined for Area and Linear families. Similarly B parameter is not defined for Linear family.
Condition "C > 0" is not the same as condition "C is defined". You are writing former while you need latter. I doubt if some syntax similar to If(Defined(C)....) is supported by Revit 9.0. You will probably need a workaround. Consider either adding B and C to all families or adding B and C to appropriate category in Settings > Project Parameters.

E-Key
2006-08-02, 12:13 PM
You will probably need a workaround. Consider either adding B and C to all families or adding B and C to appropriate category in Settings > Project Parameters.Just adding the parameters to Project Parameters list dosn't have an effect. To get the formula to work I have to set values to zero for parameters originally not defined in family. It's an additional piece of time :(



Condition "C > 0" is not the same as condition "C is defined". You are writing former while you need latter. I doubt if some syntax similar to If(Defined(C)....) is supported by Revit 9.0. Before sending the thread I played with operators. I hoped to find undocumented one. I tried "Exists" operator because schedules have filter condition "exists". But "Exists" doesn't exists as well as "Defined" one. Using "C > 0" expression makes the formula to work partially. No end result. I bumped for the problem before but now I desire logical operators like "Exists" or "Defined" very much. So I'll wait while developers catch the problem.

Leonid, thanks for your suggestions.

LRaiz
2006-08-02, 12:25 PM
So I'll wait while developers catch the problem.

I don't see a point in just waiting. You may want to log in an enhancement request with customer support.

clog boy
2007-09-28, 07:49 AM
Found this thread using a search. I'm in need for more operators too, like =! [parameter] (states that that parameter is not defined) or =if [parameter1]>1 | if[parameter2] < 10 (| means OR, a very commonly used operator for script languages).
The latter is possible using the ELSE position for an IF-statement.

Useful thread tho. This exlpains a lot about schedules using very few words.

Calvn_Swing
2007-09-28, 08:33 PM
Indeed, more operators, and more options too! I'd like to be able to use more parameter types in formulas, and define the values for more parameter types using formulas. Especially "Family Type" parameters. Adding that into the "equation" would be super nifty. (pun intended!)