Forums
Forums >> Revit Building >> Technical Support >> Syntax issue: Left Parenthesis is Not Expected
|
|
active
Joined: Fri, Jul 17, 2015
0 Posts No Rating |
I am creating a door family that will show the required ADA clearance for doors. Clearance dimensions vary depending on approach direction, whether you are pushing or pulling the door, whether you have a latch, and whether you have a closer. I have yes/no parameters set up for Push, Latch, and Closer. Approach direction is coded (1=front approach, 2= hinge side approach, 3= latch side approach) as an integer parameter. All of these are instance parameters.
Right now I'm working on the clearance that is needed on the side of the door that latches. Here's the logic I want to use
- If Push is not checked, 18"
- If Push is checked, AND latch AND closer are checked, 12"
- If Push is checked but latch and closer are not both checked, 0"
I used the following syntax, and got the "Left Parenthesis is not expected" error:
=if(Push (and(Latch, Closer, Approach Direction = 1), 1'),18")
When I delete the left perenthesis in front of "Push" or "and," I get errors that "if Push", and "and Latch" are not valid parameters. When I delete the left parenthesis in front of "Latch", it doesn't complain about valid parameter names, but it gives me the same "Left parenthesis is not expected" message.
Any ideas?
(Note that in the attached file, there isn't anything in the formula for Latch Clearance Width because it won't let me save the formula that it thinks is erroneous.)
|
This user is offline |
|
 |
|
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
 |
Did you look at the HELP?
|
This user is offline |
|
 |
active
Joined: Tue, Sep 27, 2011
2 Posts No Rating |
There are a couple items wrong in your formula. To start, yes or no statements cannot understand "=1". I know you are saying that if they are checked (which is 1 in revit terms) then it should follow. However, when using a condition for a yes/no parameter, you just say the name of the yyes/no paramter. If its unchecked, revit understands that you are only interested in if its unchecked. As for the "Left Pararenthis is unexpected", I can see what is wrong just by looking at your formula synatax. You have to go back to your days of learning algebra formulas. Everything in the inner brackets is done (calculated) first, then it moves to the next level. For every level of calculating, you need to have more parathesis. So to make your formula work, try this:
if((and(Push , Latch, Closer), 1", 18")
You can also nest IF statments such as:
IF ( Length < 500 , 100 , IF ( Length < 750 , 200 , IF ( Length < 1000 , 300 , 400 ) ) ) Returns 100 if Length<500, 200 if Length<750, 300 if Length<1000 and 400 if Length>1000
If statments can be really confusing especially with yes/no parameters.
|
This user is offline |
View Website
|
 |
active

Joined: Thu, May 28, 2009
829 Posts
 |
So, I see your problems. two issues, your formula won't do what you want, and the error you got about the parathesis is about your second to last ). syntax words like this: IF(X), true , false. You have to leave the true/false results "clean" and merely separated by a comma. That comma is the entire backbone of your formula.
=if(Push (and(Latch, Closer, Approach Direction = 1), 1'),18")
should read
=IF(AND(Push , Latch , Closer , (Approach Direction) = 1) , 12" , IF(AND(Latch , Closer , (Approach Direction) = 1 , NOT(Push))) , 18" , IF(AND(Push , NOT(Latch) , NOT(Closer))) , 0" , 18"))
Okay. That's a really rough stab at it.
Here's the logic of it written out:
if push, latch, closer, and appraoch direction = 1 are all true, set to 12"... if everything is true but NOT push, set to 18", if it isn't the first configuration, if it isn't the second configuration, but push is checked and NOT latch and NOT closer, set to 0"... but if the THIRD option isn't even true, default to 18".
I don't know how you want to end it. You could leave off the entire last "IF(AND(Push , NOT(Latch) , NOT(Closer))) , 0" , 18"))" and replace it with 0" if you KNOW that you only have your three conditions.
hope that helps.
Edited on: Thu, Sep 3, 2015 at 5:45:38 PM
|
This user is offline |
|
 |
 |
Similar Threads |
Way around circular formuala references? |
Revit Building >> Technical Support
|
Mon, Nov 18, 2013 at 10:43:21 AM
|
0
|
Formula Syntax for PI |
Revit Structure >> Technical Support
|
Thu, Sep 13, 2012 at 6:20:34 PM
|
6
|
What is the syntax error in this pattern |
Revit Building >> Technical Support
|
Sun, Sep 27, 2009 at 11:25:25 AM
|
2
|
If you are having cloud rendering issues "Bug" |
Revit Building >> Tips & Tricks
|
Mon, May 20, 2013 at 3:40:19 PM
|
2
|
Spot Dimension |
Revit Building >> Technical Support
|
Fri, Jan 20, 2006 at 11:23:28 AM
|
0
|
 |
|
Site Stats
Members: | 2078789 | Objects: | 23120 | Forum Posts: | 152270 | Job Listings: | 3 |
|