Forums >> Revit Building >> Technical Support >> IF STATEMENTS
|
|
active
Joined: Mon, Jun 10, 2013
40 Posts No Rating |
Hi
I'm trying to write an if statement as part of a yes/no parameter in a family. I have two instance linear dimensions, and when the yes/no statement is ticked on, I want those two instance parameters to be equal. I thought this was possible but I'm having trouble with the syntax of writing the formula. Can someone write it out for me? Call the two instance parameters A and B for simplicity
Thanks
|
This user is offline |
|
![](images/spacer.gif) |
|
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
![3.5 Stars: 396 Votes](/images/stars_3.5.gif) |
Conditional statement sytax is clearly defined in your HELP - http://help.autodesk.com/view/RVT/2015/ENU/?guid=GUID-A0FA7A2C-9C1D-40F3-A808-73CD0A4A3F20
If you don't see what you want to do, you can't do it.
|
This user is offline |
|
![](images/spacer.gif) |
active
Joined: Mon, Jun 10, 2013
40 Posts No Rating |
First place I looked thanks, because I knew you were going to come on here and say that!
WWHub, I will no stop posting here specifically because of you.
|
This user is offline |
|
![](images/spacer.gif) |
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
![3.5 Stars: 396 Votes](/images/stars_3.5.gif) |
Obviously you don't read the posts or the HELP.
The help clearly tells you WHAT YOU CAN DO WITH CONDITIONAL STATEMENTS !!!!
Perhaps if you had shown us what you were writing we could point out your error but you want us to do all your work.
Good Bye!
|
This user is offline |
|
![](images/spacer.gif) |
active
Joined: Wed, Aug 19, 2015
0 Posts
![4.5 Stars: 10 Votes](/images/stars_4.5.gif) |
I have not done anything in revit with conditional logic but I think you would first need a dimension parameter for the entire length for a reference. then a parameter named HALFLENGTH that pulls the value of half of that overall length dimension and then you would set A,B to equal HALFLENGTH when Visablitly is on.
|
This user is offline |
|
![](images/spacer.gif) |
active
Joined: Wed, Aug 19, 2015
0 Posts
![4.5 Stars: 10 Votes](/images/stars_4.5.gif) |
I think this is how the statement would be.
We will call your yes/no parameter VIS and use HALFLENGTH from my previous post.
=IF (VIS, (A=HALFLENGTH, B=HALFLENGTH), (A, B))
|
This user is offline |
|
![](images/spacer.gif) |
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
![3.5 Stars: 396 Votes](/images/stars_3.5.gif) |
marmik,
You should try this out in a simple generic family. Look again at your syntax according to the HELP I pointed out earlier.
|
This user is offline |
|
![](images/spacer.gif) |
active
Joined: Wed, Aug 19, 2015
0 Posts
![4.5 Stars: 10 Votes](/images/stars_4.5.gif) |
I did look at the help you had posted and used IF (<condition>, <result-if-true>, <result-if-false> to make my statement. I currently am out of office and dont have acces to revit so i cannot try it. The only though i have is that maybe you cannot assign multiple values as results the way I am showing it.
|
This user is offline |
|
![](images/spacer.gif) |
active
Joined: Wed, Aug 19, 2015
0 Posts
![4.5 Stars: 10 Votes](/images/stars_4.5.gif) |
that smiley was suppossed to be a ) as it was copy pasted. and sorry for the change in font as it switched when copy pasted.
|
This user is offline |
|
![](images/spacer.gif) |
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
![3.5 Stars: 396 Votes](/images/stars_3.5.gif) |
Look again when you have time. Your are setting a value for a variable.
<Variable> you write"...=IF (VIS, (A=HALFLENGTH, B=HALFLENGTH), (A, B))" This does not conform.
IF (<condition>, <result-if-true>, <result-if-false> ) How can <Variable> = (A=Halflength)????
Must be something like A =If(VIS,HALFLENGTH, <....BUT WHAT GOES HERE?....>![Winking](/images/smiles/wink.gif)
You have to figure out how to get the second , if false, condition. If you can't do the correct syntax, then you can't do this.
Sorry for the larger case ... came in when I copied your post.
|
This user is offline |
|
![](images/spacer.gif) |
|
active
Joined: Wed, Aug 19, 2015
0 Posts
![4.5 Stars: 10 Votes](/images/stars_4.5.gif) |
I see what you mean with setting my value for a variable. In your post in the "BUT WHAT GOES HERE?" part, that would be something that VonBraun would have to decide on I guess as he did not provide us with and general values originally. Hopefully he is able to figure out what he is trying to do with what we have discussed.
|
This user is offline |
|
![](images/spacer.gif) |
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
![3.5 Stars: 396 Votes](/images/stars_3.5.gif) |
It would have been better if the original poster had "shown his work" because there is no answer otherwise.
Well thought out and asked questions are great but some posters just want someone else to do their work.
|
This user is offline |
|
![](images/spacer.gif) |
![](images/spacer.gif) |