Results 1 to 8 of 8

Thread: Conditional statements in fields in attributes in dynamic blocks

  1. #1
    Member
    Join Date
    2001-11
    Location
    Buffalo, NY
    Posts
    34
    Login to Give a bone
    0

    Default Conditional statements in fields in attributes in dynamic blocks

    Boy that was a long, buried title. I hope I can get some direction here. From all that I've read, it seems that I will be unable to do what I need to, but I'd thought I'd try anyway.

    I have a dynamic block of a pier. Said pier has 2 linear parameters, one in the X direction and one in the Y direction. With appropriate stretch actions associated with them that are set at a defined list of sizes. There are fields in an attribute attached to the block that will read the x and y dimensions and produce a result: 30"x30" CONC. PIER FOOTING. The size updates as the block is stretched. No problem, works great.

    What I want to do is add the third dimension: 30"x30"x15" CONC. PIER FOOTING. I want the third dimension to equal half of the smallest side of the pier. So, the condition would look like this (I'll use X and Y to denote each side): IF(X<Y, X/2, Y/2)
    Right?
    Here's my syntax in the formula editor: IF ((UpdatedDistance<UpdatedDistance), (UpdatedDistance/2), (UpdatedDistance/2)) Where UpdatedDistance is an inserted BlockPlaceHolder field assigned to either the x or y parameter.Why it says UpdatedDistance and not the names of the parameter is beyond me (X Distance and Y Distance). However, when each UpdatedDistance field is selected and edited in the formula it does point to the correct parameter.

    After wasting nearly a day, I can't get it to work. It returns the ### every time. Is it simple syntax or am I missing something greater? Any help is welcomed and is greatly appreciated!
    Thanks,

    Chad

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Conditional statements in fields in attributes in dynamic blocks

    What if you simply divide the mininum of the two values by 2?
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    Member
    Join Date
    2001-11
    Location
    Buffalo, NY
    Posts
    34
    Login to Give a bone
    0

    Default Re: Conditional statements in fields in attributes in dynamic blocks

    That is what I'm trying to do, but I want the software to do it. I want the user to be able to stretch the pier to size and have the formula calculate the depth automatically. That is why I believe I need an IF statement to determine the smaller of the two sizes (they're not always the same). The x direction could be 48" while the y could be 24". Maybe I am over thinking this?

    Thanks.

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Conditional statements in fields in attributes in dynamic blocks

    Quote Originally Posted by 70melbatoast View Post
    Maybe I am over thinking this?
    I may be mistaken, but isn't there a MIN operator available in formulas?

    MIN(x,y)/2
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  5. #5
    Member
    Join Date
    2001-11
    Location
    Buffalo, NY
    Posts
    34
    Login to Give a bone
    0

    Default Re: Conditional statements in fields in attributes in dynamic blocks

    Thanks for the reply Robert. I did not know that expression existed. Formulas are a bit new to me and I'm learning at a snails pace. As an example, I've tried a simple expression (MIN(10,6)/2) and the more complex (MIN(UPDATEDDISTANCE,UPDATEDDISTANCE)/2) and I still get the ###. Whether I created the formula in simple mtext or as an attribute in my dynamic block makes no difference. Hmmm...
    Last edited by 70melbatoast; 2008-10-14 at 05:27 PM. Reason: Spelling errors

  6. #6
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Conditional statements in fields in attributes in dynamic blocks

    Quote Originally Posted by 70melbatoast View Post
    Thanks for the reply Robert. I did not know that expression existed. Formulas are a bit new to me and I'm learning at a snails pace. As an example, I've tried a simple expression (MIN(10,6)/2) and the more complex (MIN(UPDATEDDISTANCE,UPDATEDDISTANCE)/2) and I still get the ###. Whether I created the formula in simple mtext or as an attribute in my dynamic block makes no difference. Hmmm...
    Are you copying and pasting the field expressions for the two values in question into the formula, or simply trying to type the name of the dynamic property? I think you should copy the field expressions.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  7. #7
    Member
    Join Date
    2001-11
    Location
    Buffalo, NY
    Posts
    34
    Login to Give a bone
    0

    Default Re: Conditional statements in fields in attributes in dynamic blocks

    I have been copying the expressions or I will I use right-click insert or edit field.

  8. #8
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    285
    Login to Give a bone
    0

    Default Re: Conditional statements in fields in attributes in dynamic blocks

    you could just add another line that is half the distance and call it up with the field. Then add a visibility paramater and turn the display of the line off. Also, turn the visibility grip off. oh, and you'll also need to include the new line with the stretch parameters you are using.

Similar Threads

  1. 2014: Attributes, Fields and Dynamic Blocks
    By kROSEMAN in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2015-06-29, 11:36 PM
  2. Conditional Statements with Contains or Does not Contain?
    By Karlfucious in forum Revit - Platform
    Replies: 2
    Last Post: 2011-06-20, 06:19 PM
  3. Conditional Statements
    By dkriete in forum Revit Architecture - Families
    Replies: 8
    Last Post: 2009-11-24, 04:57 PM
  4. Conditional Dependencies in Dynamic Blocks
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2009-02-09, 03:48 PM
  5. Conditional Statements
    By al in forum Revit Architecture - Families
    Replies: 0
    Last Post: 2006-11-08, 06:01 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
  •