PDA

View Full Version : Revit Variables, Formulas, Conditions...



Rudy Tovar
2007-04-30, 04:46 PM
Hello, and thank you to everyone that may reply...

My question is in regards to formulas, variable conditions...

Here's what I'm trying to do...

IF (current value > 0' 0", keep value, set value)

Now...I'm just getting started in conditions, but have been coming from an Autocad environment... Have programmed for over 15 years... LISP, ActiveX, Object DBX...

I don't know if all expressions, conditions, variables have been exposed on some site...or should I just ask for a total count of all allowed expressions, and formulas....

I just want to be able to check the value entered and have it keep the value if greater than 0 (zero), if not then set the value back to the previous value or display a warning.

I'm trying to move away from my old ways of thinking, and move toward enhancing my understanding on how Revit objects, families, have family parameters work....

I welcome all your comments, and ask for direction on family parameters, and formula expressions, conditions, and exposed codes...

Thank you once again.

mjdanowski
2007-04-30, 05:12 PM
I don't believe parameters can reverence themselves, it is really a pain in the ***.

glynnis.patterson
2007-04-30, 06:52 PM
You should be able to type "if(value>0,value,1)"
I don't think you could have it type any kind of error message, but you could certainly set it to a specific value.

mjdanowski
2007-04-30, 07:46 PM
You should be able to type "if(value>0,value,1)"
I don't think you could have it type any kind of error message, but you could certainly set it to a specific value.

if he is trying to use the current value of the parameter though, he will get an error for circular chain of references.

Some programming languages will let you do an equivalent script of if (A > 0, A - 1) else (A) type deal, but apparently not Revit.

Steve_Stafford
2007-05-01, 12:37 AM
If you have the user provide values in separate fields you can evaluate those and do the work you need do based on that instead. You just need to separate the evaluation since Revit doesn't support evaluating the value of the parameter itself within its own formula column.

Rudy Tovar
2007-05-01, 01:12 AM
Thanks everyone...I guess there's a bit more for the wish list...