RevitCity.com Logo

Home  |  Forums  |  Downloads  |  Gallery  |  News & Articles  |  Resources  |  Jobs  |  FAQ  |  SearchSearch  |  Join  |  LoginLogin

Welcome !

63 Users Online (62 Members): Show Users Online - Most ever was 626 - Mon, Jan 12, 2015 at 2:00:17 PM

 

Forums

Forums >> Revit Building >> Technical Support >> Formula to not exceed value in family

Search this ThreadSearch this Thread | Page 1 of 1 |

Tue, May 20, 2008 at 8:20:55 AM | Formula to not exceed value in family

#1

kyoungblut


active

Joined: Tue, Oct 30, 2007
21 Posts
No Rating


I am looking to see if there is a formula that will not allow a object to exceed a certail length or depth.  I don't want people to be able to design over the specified values, but can still insert any value up to that point.

This user is offline

View Website

Tue, May 20, 2008 at 9:49:11 AM | Formula to not exceed value in family

#2

rkitect


active
rkitect Avatar

Joined: Thu, Dec 16, 2004
792 Posts
4 Stars: 29 Votes


if(paramName>maxValue, paramName=maxValue)

if(paramName<minValue, paramName=minValue) 

 

replace paramName with the name of the parameter the formula is in. 

My suggestion would be to actually make parameters called maxValue and minValue so that the max and min values can be adjusted in future use.


-----------------------------------

-//------------------------

Carl - rkitecsure[at]gmail.com

Need help? I'm probably in my chat room!

You fell victim to one of the classic blunders. The most famous is never get involved in a land war in asia, but only slightly less well known is this! Never go in against a Sicilian when death is on the line!

This user is offline

View Website

Tue, May 20, 2008 at 9:53:34 AM | Formula to not exceed value in family

#3

lunchtrayrider


active

Joined: Sun, Jun 24, 2007
592 Posts
3.5 Stars: 7 Votes


stolen from revit help I think what you want is NOT(a>b) sort of thing

 

Syntax for Conditional StatementsA conditional statement uses this structure: IF (<condition>, <result-if-true>, <result-if-false>WinkingThis means that the values entered for the parameter depend on whether the condition is satisfied (true) or not satisfied (false). If the condition is true, the software returns the true value. If the condition is false, it returns the false value. Conditional statements can contain numeric values, numeric parameter names, and Yes/No parameters. You can use the following comparisons in a condition: <, >, =. You can also use Boolean operators with a conditional statement: AND, OR, NOT. Currently, <= and >= are not implemented. To express such a comparison, you can use a logical NOT. For example, a<=b can be entered as NOT(a>b). The following are sample formulas that use conditional statements. Simple IF: =IF (Length < 3000mm, 200mm, 300mm)IF with a text parameter: =IF (Length > 35', “String1”, “String2&rdquoWinkingIF with logical AND: =IF ( AND (x = 1 , y = 2), 8 , 3 ) IF with logical OR: =IF ( OR ( A = 1 , B = 3 ) , 8 , 3 )Embedded IF statements: =IF ( Length < 35' , 2' 6" , IF ( Length < 45' , 3' , IF ( Length < 55' , 5' , 8' ) ) )IF with Yes/No condition: =Length > 40 (Note that both the condition and the results are implied.)



Edited on: Tue, May 20, 2008 at 9:57:46 AM

-----------------------------------
I like scooters. and motorcycles.

This user is offline

 

Tue, May 20, 2008 at 9:59:16 AM | Formula to not exceed value in family

#4

lunchtrayrider


active

Joined: Sun, Jun 24, 2007
592 Posts
3.5 Stars: 7 Votes


replace smiley faces with )

-----------------------------------
I like scooters. and motorcycles.

This user is offline

 

Tue, May 20, 2008 at 10:06:42 AM | Formula to not exceed value in family

#5

TABEST


active

Joined: Wed, May 9, 2007
141 Posts
4 Stars: 4 Votes


to do this, create an extra parameter for each value you want to control.  These will be "input" values.  In your actual parameter (the one that controls some dimension, or value in the family) you will compare he "input" value to your MAX and/or MIN value, if the value is in range, then you will let it be the value, otherwise you will set the value,  Below is an example:

 Input - a parameter of type length

Value - a parameter of type length which controls the length of a sofa.

I want to constrain the sofa to not less than 3' and no greater than 10', so as follows in the = area of the value parameter:

if(or(and(Input<10', Input >3'), or(Input=10', Input=3')), Input, if(Input<3', 3', 10'))

the above does the following, it tests to see if the Input is within the range of 3' or 10', if it is in that range, then we let Value equal Input, otherwise, it tests to see if Input is at the lower or higher extreme, and then sets the sofa's length to be either 3' or 10'. 

If a user put in 11, the above if statement would be false, so we'd then be testing to see if input is less than 3', which it isn't, so Value will be set to 10. 

Feel free to ask further questions about this, as I'm sure I didn't explain it perfectly, but hope this helps.


This user is offline

 

Tue, May 20, 2008 at 10:33:01 AM | Formula to not exceed value in family

#6

kyoungblut


active

Joined: Tue, Oct 30, 2007
21 Posts
No Rating


Thanks for all the help i will try these out and report back Winking

This user is offline

View Website

Tue, May 20, 2008 at 12:34:26 PM | Formula to not exceed value in family

#7

rkitect


active
rkitect Avatar

Joined: Thu, Dec 16, 2004
792 Posts
4 Stars: 29 Votes


Sorry, my syntax is incorrect as pointed out by Lunch.  Instead of "paramName=maxValue" it would just be "maxValue" for that conditional statement value.

-----------------------------------

-//------------------------

Carl - rkitecsure[at]gmail.com

Need help? I'm probably in my chat room!

You fell victim to one of the classic blunders. The most famous is never get involved in a land war in asia, but only slightly less well known is this! Never go in against a Sicilian when death is on the line!

This user is offline

View Website

Search this ThreadSearch this Thread | Page 1 of 1 |



Similar Threads

Thread/Thread Starter

Forum

Last Post

Replies

One family parameter has formula one has none

General Discussion >> Revit Project Management

Wed, Jun 25, 2014 at 1:05:54 PM

7

Family w/ Array Formula

Revit Building >> Technical Support

Fri, Mar 23, 2007 at 9:29:37 AM

8

Family types - conditional statement

Revit Systems >> Technical Support

Mon, Apr 18, 2011 at 3:59:50 PM

4

Beam Family Array Formula Help

Revit Building >> Technical Support

Thu, Oct 23, 2014 at 9:40:34 AM

3

Variable Length Family with Array Formula

Revit Building >> Technical Support

Wed, Aug 8, 2012 at 9:56:46 AM

2

Site Stats

Members:

2056478

Objects:

23071

Forum Posts:

152325

Job Listings:

3

Sponsored Ads

Home | Forums | Downloads | Gallery | News & Articles | Resources | Jobs | Search | Advertise | About RevitCity.com | Link To Us | Site Map | Member List | Firm List | Contact Us

Copyright 2003-2010 Pierced Media LC, a design company. All Rights Reserved.

Page generation time: 0.8648

Login

User Name:

Password:

Remember Me  

Forgot Password?

Search Forums

Advanced Search

Search Forums

Advanced Search


Clear Highlights


Clear Highlights