Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Inconsistent Units in Yes/No Parameter if/and Statement

  1. #1
    New Member
    Join Date
    December 1, 2014
    Posts
    2
    Current Local Time
    01:37 AM

    Not allowed! Not allowed!

    Inconsistent Units in Yes/No Parameter if/and Statement

    So I have what should be a simple if/and conditional statement that I'm using to drive a Yes/No parameter in my L-shaped countertop family. The family contains instance parameters to control an angled corner, and rounded edges.

    My statement is as follows: = if (and (corner angle, left radius), 1, 0)

    where "corner angle" and "left radius" are both instance yes/no parameters.

    However Revit rewards me with the dreaded "inconsistent units" error. Can anyone explain why this might be happening?



    Click image for larger version. 

Name:	countertop statement screenshot.PNG 
Views:	109 
Size:	22.7 KB 
ID:	20002

  2. #2
    Senior Member PijPiwo's Avatar
    Join Date
    May 20, 2011
    Location
    Chicago, IL
    Posts
    795
    Current Local Time
    12:37 AM

    Not allowed! Not allowed!
    This might help.

  3. #3
    Mr. Revit OpEd
    Join Date
    December 14, 2010
    Posts
    3,031
    Current Local Time
    09:37 PM

    Not allowed! Not allowed!
    Revit doesn't accept 1 or 0 as a value for a yes/no parameter.

    You could write the formula like this instead:

    not(and(corner angle,left radius))

    In plain english the formula reads, "This parameter is not checked only when corner angle AND left radius are."

    In contrast:

    and(corner angle,left radius)

    In plain english the formula reads, "This parameter is checked only when corner angle AND left radius are."
    Last edited by Steve_Stafford; December 1st, 2014 at 09:06 PM. Reason: restated the logic

  4. #4
    Forum Addict GMcDowellJr's Avatar
    Join Date
    December 21, 2010
    Location
    Phoenix, AZ
    Posts
    2,668
    Current Local Time
    10:37 PM

    Not allowed! Not allowed!
    Quote Originally Posted by Steve_Stafford View Post
    Revit doesn't accept 1 or 0 as a value for a yes/no parameter.
    But it accepts 1=1 and 1=2 (or their equivalents) for Yes and No respectively.

  5. #5
    Mr. Revit OpEd
    Join Date
    December 14, 2010
    Posts
    3,031
    Current Local Time
    09:37 PM

    Not allowed! Not allowed!
    What Greg is suggesting is that you can keep your formula but written like this instead:

    if (and (corner angle, left radius), 1=1, 1=2)

    Instead of just using 1 or 0, providing a switch value, let Revit evaluate the true/false result as a math problem to solve. 1 is equal to 1, that's true. 1 is not equal to 2, that's false. Make sense?

  6. #6
    New Member
    Join Date
    December 1, 2014
    Posts
    2
    Current Local Time
    01:37 AM

    Not allowed! Not allowed!
    Excellent. I tried both solutions and they both work as you have described. I like the simplicity of the "and(left radius, corner angle)" formula, but it's nice to know that I wasn't too far off track with my original concept.

    Thanks for the help.

  7. #7
    Junior Member
    Join Date
    July 27, 2012
    Location
    singapore
    Posts
    14
    Current Local Time
    01:37 PM

    Not allowed! Not allowed!
    Hi all,

    I tried to create visibility for void using if then statement , but the inconsistent unit is killing me,

    needed help , i not sure where it goes wrong ?

    Thank in advance guy !

    Click image for larger version. 

Name:	void visibility.jpg 
Views:	66 
Size:	277.3 KB 
ID:	26152Click image for larger version. 

Name:	door plan.jpg 
Views:	25 
Size:	90.2 KB 
ID:	26153

  8. #8
    Forum Addict GMcDowellJr's Avatar
    Join Date
    December 21, 2010
    Location
    Phoenix, AZ
    Posts
    2,668
    Current Local Time
    10:37 PM

    Not allowed! Not allowed!
    I see 2 errors; replace 1, and 0 with 1=1, and 1=2 (assuming you meant for 1 to equal true/on and 0 to equal false/off), and remove "Void_L ="


    Sent from my iPhone using Tapatalk

  9. #9
    Member ScubaMan's Avatar
    Join Date
    July 7, 2015
    Posts
    203
    Current Local Time
    10:37 PM

    Not allowed! Not allowed!
    I did not know you could use 1=1 and 1=2. I have always done 1<2 and 1>2. Same difference i guess.

    Thanks for the info guys,

  10. #10
    Junior Member
    Join Date
    July 27, 2012
    Location
    singapore
    Posts
    14
    Current Local Time
    01:37 PM

    Not allowed! Not allowed!
    Quote Originally Posted by GMcDowellJr View Post
    I see 2 errors; replace 1, and 0 with 1=1, and 1=2 (assuming you meant for 1 to equal true/on and 0 to equal false/off), and remove "Void_L ="


    Sent from my iPhone using Tapatalk

    Click image for larger version. 

Name:	reply .jpg 
Views:	14 
Size:	112.5 KB 
ID:	26170Click image for larger version. 

Name:	reply 2.jpg 
Views:	26 
Size:	317.7 KB 
ID:	26171

    hi Greg,

    I end up created another parameter by tying Void=L another ref. plane in order for "Void=L" to function with length

    1) Void Extrusion don't have a visibility on/off check box

    I tried IF ( AND (x = 1 , y = 2), <true>, <false>)
    Returns <true> if both x=1 and y=2, else <false>

    but still not able to make it ... can show how to write the 1=1 and 1=2 formula ?

    thankss

Similar Threads

  1. Revit - Inconsistent Units and how to neutralize them.
    By Munkholm in forum Tutorials, Tips & Tricks
    Replies: 27
    Last Post: July 12th, 2019, 03:07 AM
  2. Yes/No Parameter in Conditional Statement
    By keithwales in forum Architecture and General Revit Questions
    Replies: 3
    Last Post: September 16th, 2014, 06:00 PM
  3. Replies: 12
    Last Post: June 4th, 2013, 08:08 PM
  4. Yes/No type parameter with if statement, help
    By srsatdmi in forum Architecture - Family Creation
    Replies: 7
    Last Post: December 5th, 2012, 04:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •