Parameter Formula Conditional Statements

Parameter Formula Conditional Statements

jacques
Advocate Advocate
1,448 Views
7 Replies
Message 1 of 8

Parameter Formula Conditional Statements

jacques
Advocate
Advocate

Hello , you all:

 

I am trying to add a parameter for a component that at present time can be extended to infinity.  This is controlled by an instance parameter called "A".  I want to limit this to 3950mm. So, a conditional statement seems like the logical thing. So, I started from this page:

 

https://knowledge.autodesk.com/support/revit-products/learn-explore/caas/CloudHelp/cloudhelp/2014/EN...

 

But, that didn't help. If I try a simple IF ( A > 3950mm, 3950mm), it tells me that it is a bad IF statement format. I tried setting a lower limit such as IF ( A > 3950mm, 3950mm , IF ( A < 100mm, 100mm))), I then get unexpected left parenthesis, or a string of errors if I remove I move things around. I suspect that the answer is there or there about. But it is in the right sequence.

 

Can anyone help?

0 Likes
Accepted solutions (1)
1,449 Views
7 Replies
Replies (7)
Message 2 of 8

L.Maas
Mentor
Mentor

The if parametermeter works with a true and false like:

=if(A>1000, 1000, 500)

so....if(testcondition, value if testconditon true, value if testconditon false)

and when you start nesting if statements yooul need a true and flase reulst for all the if statements like:

if(A>1000, 1000, if(B>1000,1000, 500))

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Message 3 of 8

barthbradley
Consultant
Consultant
0 Likes
Message 4 of 8

ToanDN
Consultant
Consultant
Accepted solution

@jacques wrote:

Hello , you all:

 

I am trying to add a parameter for a component that at present time can be extended to infinity.  This is controlled by an instance parameter called "A".  I want to limit this to 3950mm. So, a conditional statement seems like the logical thing. So, I started from this page:

 

https://knowledge.autodesk.com/support/revit-products/learn-explore/caas/CloudHelp/cloudhelp/2014/EN...

 

But, that didn't help. If I try a simple IF ( A > 3950mm, 3950mm), it tells me that it is a bad IF statement format. I tried setting a lower limit such as IF ( A > 3950mm, 3950mm , IF ( A < 100mm, 100mm))), I then get unexpected left parenthesis, or a string of errors if I remove I move things around. I suspect that the answer is there or there about. But it is in the right sequence.

 

Can anyone help?


For your specific example, you need another parameter to enter the value, lets' call it A_input

The formula for A:  if (A_input > 3950, 3950, A_input)

 

Capture.PNG

0 Likes
Message 5 of 8

jacques
Advocate
Advocate

Hej Toad:

 

Thanks for that. I have done exactly what you typed. And now I get no errors. However, it won't limit the length. Should I add the conditional on another parameter? 

0 Likes
Message 6 of 8

ToanDN
Consultant
Consultant
Yes. The input parameter is to enter teh value. The parameter with the formula is to assigned to a dimension label.
0 Likes
Message 7 of 8

jacques
Advocate
Advocate

Got it. I had it backwards. It works now. 

 

One thing I noticed is that the hot-grip disappeared. Any idea of hot to get it back?

0 Likes
Message 8 of 8

David_W_Koch
Mentor
Mentor

@jacques wrote:

Got it. I had it backwards. It works now. 

 

One thing I noticed is that the hot-grip disappeared. Any idea of hot to get it back?


 

You can add another Reference Plane (make it a weak reference) to one side of model and place a dimension from the Reference Plane at the far side of your model to the new Reference Plane, and then label that dimension with the A_input parameter.  That will restore a grip.  If A_Inupt is less than or equal to the maximum allowed value, the new Reference Plane and the grip will be at the location of the object end.  If A_input exceeds the maximum, the grip will be located beyond the end of the actual object, as the object will be limited to the maximum value.


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

0 Likes