Announcement

Collapse
No announcement yet.

SOS! -> IF statements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SOS! -> IF statements

    Hi all,

    Is someone here with a good vieuw on IF-THEN statements?

    In this case I need revit to select BLACK if THE BLACK_WHITE checkbox is marked, and WHITE if the checkbox is clear.
    I tought it would be something like this:

    IF(BLACK_WHITE=1,500mA_BLACK=1,500mA_WHITE=0)

    Getting the error" Improper use of boolean expressions."



    Can some1 help me out please ?
    Attached Files

    #2
    Since yes/no parameters only have 2 possible conditions, there's no need for the if/then statement. The parameter itself is the test.
    It looks like you have a lot more going on in that family that may need some and/or statements, but the basic syntax would be this:
    1,500mA_BLACK=BLACK_WHITE
    1,500mA_WHITE= not(BLACK_WHITE)

    Comment


      #3
      Thx

      and is there also a statement to select a color in a material database ? or isn't this possible ?

      Originally posted by chris.macko View Post
      Since yes/no parameters only have 2 possible conditions, there's no need for the if/then statement. The parameter itself is the test.
      It looks like you have a lot more going on in that family that may need some and/or statements, but the basic syntax would be this:
      1,500mA_BLACK=BLACK_WHITE
      1,500mA_WHITE= not(BLACK_WHITE)

      Comment


        #4
        Originally posted by Allu View Post
        Thx

        and is there also a statement to select a color in a material database ? or isn't this possible ?
        Try Dynamo? Materials don't do formulas, let alone dynamic material selection on their own.
        Julie Kidder
        Architect + BIM Director
        Hartman + Majewski Design Group

        Comment


          #5
          Why not just use a Material parameter instead of a tick box? Link an instance parameter to the 'Material' parameter of the geometry you want to change and the user can select black, or white (Or red/glass/grass/disco ball, whatever...)
          Or do it at Type level without formulas. So yes you have to set everything correctly for the Black and White Types, but then the user only has to select which they want.

          Personally I find controlling materials with a parameter and selecting them in the project with Edit Type is good practice anyway. Then the family itself doesnt have to contain all the materials, it will use the materials that are managed in one place in the project file.
          "One must imagine Sisyphus happy." Albert Camus - "The innovator has for enemies all those who have done well under the old conditions, and lukewarm defenders in those who may ​do well under the new." Nicolo Machiavelli -"Things that are too complex are not useful, Things that are useful are simple." Mikhail Kalashnikov

          Comment


            #6
            Originally posted by josephpeel View Post
            Why not just use a Material parameter instead of a tick box? Link an instance parameter to the 'Material' parameter of the geometry you want to change and the user can select black, or white (Or red/glass/grass/disco ball, whatever...)
            Or do it at Type level without formulas. So yes you have to set everything correctly for the Black and White Types, but then the user only has to select which they want.

            Personally I find controlling materials with a parameter and selecting them in the project with Edit Type is good practice anyway. Then the family itself doesnt have to contain all the materials, it will use the materials that are managed in one place in the project file.
            I agree that materials should live in the project, and the family should have material parameters. I do wish they could be controlled by formulas though, so I could do such things as defining a typical and emergency color and then having the element be assigned a material with a formula like "if(Emergency, Emergency_Finish, Standard Finish). The same would be handy for formulas in families where a part may or may not be an accent color. I'd like to be able to only define the standard color once, and have it assigned elsewhere by formula.
            Julie Kidder
            Architect + BIM Director
            Hartman + Majewski Design Group

            Comment

            Related Topics

            Collapse

            Working...
            X