Jump to content

Trying to use IF statement with calculation?


tzframpton

Recommended Posts

I was hoping to get this working but am coming up empty. And I'm wondering why in Revit a Conditional Statement cannot contain non-numeric parameter names? It seems if this were true my formula would work just fine.

 

Anyways, what I'm trying to do is have an if() condition for calculating the VA based on the number of poles on an electrical connector. The basic syntax is like this:

 

IF (, , )

 

When I type out this formula in Revit, it doesn't work. Which is weird because if I change the parameter name in the Condition to a numeric value, it doesn't break and it calculates. But the formulas in the two results statements do have non-numeric parameter names. Here's the parameters followed by the formula:

 

Parameters:

  • Number of Poles
  • Voltage
  • FLA

Conditional Statement:

if(Number of Poles = 3, (Voltage * FLA * 1.73) / 3, (Voltage * FLA))

 

I'm hoping someone can shine some light on this. I know it's in the MEP forum but I think this isn't "MEP Specific". I'm wanting to expand this formula into a conditional statement for further efficiency and accuracy in our mechanical family standards.

 

Thanks in advance! :)

Link to comment
Share on other sites

I tried and my problem was with the "FLA" parameter. I'm guessing your parameter is "Electrical->Current". I wasn't finding any field that would allow Power*Current; Wattage should've worked, but it's not.

 

I keep getting "Inconsistent Units".

Link to comment
Share on other sites

You are correct, I have the FLA parameter set as Discipline > Current so the units read as Amperes. This way the formula calculates correctly for the VA.

 

So I found a workaround, but with a small sacrifice. If I change the hard coded Electrical "Number of Poles" Parameter to a Common > Integer Parameter, the formula works just fine. The only caveat, is that now I can't associate the Number of Poles on the Connector Element with the parameter, since it can only associates with the hard coded Electrical Parameter. But I can live with that, since the formula is more important and once an equipment is set at single or three phase, then that's it from here on out.

Link to comment
Share on other sites

So what type parameter is the formula in?

 

I had:

Number of Poles : Common->Integer

Voltage : Electrical->Power

FLA : Electrical->Current

 

But I couldn't find a parameter type that would accept the formula.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...