The result I'm working for is:
If multiple lenses are selected (via yes/no lens formula), return the multiple lens error.
If one lens is selected, return the detail number (1862-XXX).
If no lens is selected, return the no lens error.
I'm trying to combine these two formulas:
if(PTZ LENS, "1862-207", if(FIXED LENS, "1862-208", if(MULTI LENS, "1862-209", "ERROR-NO LENS SELECTED")))
if(PTZ LENS, FIXED LENS, if(PTZ LENS, MULTI LENS, if(FIXED LENS, MULTI LENS, "ERROR-MULTIPLE LENSES SELECTED)))
With this, I get unexpected end of expression
if(and(PTZ LENS, FIXED LENS, if(PTZ LENS, MULTI LENS, if(FIXED LENS, MULTI LENS, "ERROR-MULTIPLE LENSES SELECTED"))), if(PTZ LENS, "1862-207", if(FIXED LENS, "1862-208", if(MULTI LENS, "1862-209", "ERROR-NO LENS SELECTED")))
Thanks for any help.
Gelöst! Gehe zur Lösung
Gelöst von Teresa.KawaguchiGUSLM. Gehe zur Lösung
Gelöst von ToanDN. Gehe zur Lösung
I didn't have my morning coffee yet to fix the formula. But why can't you create the Y/N and Detail Number as type parameters, and create 4 family types with proper combination of Y/N boxes ticked and Detail Number value pre-entered for each type?
The family types refer to the way the camera is mounted (ie Site Pole, Corner, Unistrut, Wall Flush, Pendant). There are seven mounting options. There are four camera lens options. Having a family with 28 types (one family type for each lens type for each mounting) seems a lot.
You are mixing text and yes/no results in the two IF statement you are trying to combine:
I'm trying to combine these two formulas:if(PTZ LENS, "1862-207", if(FIXED LENS, "1862-208", if(MULTI LENS, "1862-209", "ERROR-NO LENS SELECTED")))
The first IF statement will return one of 4 text values which is OK.
if(PTZ LENS, FIXED LENS, if(PTZ LENS, MULTI LENS, if(FIXED LENS, MULTI LENS, "ERROR-MULTIPLE LENSES SELECTED)))
The second IF statement tries to return 3 yes/no values and 1 text value "ERROR-MULTIPLE LENSES SELECTED" which is not supported. It is also missing a " at the end of the "ERROR-MULTIPLE LENSES SELECTED".
Additionally, you will not be able to combine these two for the same reason as the second IF statement. You cannot mix text and yes/no results because the parameter receiving the result can only be one or the other type.
if(and(PTZ LENS, FIXED LENS, if(PTZ LENS, MULTI LENS, if(FIXED LENS, MULTI LENS, "ERROR-MULTIPLE LENSES SELECTED"))), if(PTZ LENS, "1862-207", if(FIXED LENS, "1862-208", if(MULTI LENS, "1862-209", "ERROR-NO LENS SELECTED")))
This third statement is also mixing text and yes/no types in the first part of the AND statement. The AND statement can only work with yes/no values.
Hope this helps,
-luc
@Teresa.KawaguchiGUSLM wrote:
The family types refer to the way the camera is mounted (ie Site Pole, Corner, Unistrut, Wall Flush, Pendant). There are seven mounting options. There are four camera lens options. Having a family with 28 types (one family type for each lens type for each mounting) seems a lot.
Here is the syntax:
IF ( AND (x = 1 , y = 2), <true>, <false>)
<true> is the part where you can enter the value directly
<false> is the part where you keep extending the formula with further [if(and(...]
Can I add to this a trap for two lenses being selected?
Something like if(and(FIXED LENS, MULTI LENS, 99), if(and(FIXED LENS, PTZ LENS, 99)
IF (AND (P, NOT (F), NOT (M)), "1862-207", IF (AND (F, NOT (P), NOT (M)), "1862-208", IF (AND (M, NOT (F), NOT (P)), "1862-209", "ERROR")))
replace P, F, M with your parameters
It seems to me that your are basically trying to tell the Revit user that they have to select at least one and no more than one yes/no parameter. I would suggest that you simply change the error message to say this "ERROR - NONE OR TOO MANY LENS OPTIONS SELECTED" or "ERROR - CHOOSE ONE AND ONLY ONE LENS OPTION IN THE PARAMETERS".
The if statement then becomes:
if(PTZ LENS, "1862-207", if(FIXED LENS, "1862-208", if(MULTI LENS, "1862-209", "ERROR-NONE OR TOO MANY LENS OPTIONS SELECTED")))
Sorry, didn't work but you could use @ToanDN formula and possibly extend it to give two distinct error messages this way:
IF (AND (P, NOT (F), NOT (M)), "1862-207", IF (AND (F, NOT (P), NOT (M)), "1862-208", IF (AND (M, NOT (F), NOT (P)), "1862-209", IF (AND(P,F,M),"ERROR1", "ERROR2"))))
ERROR1 = CHOOSE AT LEAST ONE LENS
ERROR2 = CHOOSE ONLY ONE LENS
Hope this helps;
-luc
This is the solution I needed.
Much appreciation for your help in getting here.
Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.