Min and Max Length Parameter

Min and Max Length Parameter

mmarcarelliNX
Contributor Contributor
9,074 Views
16 Replies
Message 1 of 17

Min and Max Length Parameter

mmarcarelliNX
Contributor
Contributor

I have an interesting dilemma that I'm sure some of you may have run into before. I have an element that needs to have a defined minimum and maximum length associated with them.

 

I'm using a Length (user input length value) and Length Calc (this uses a nested if statement) set of length parameters.

 

Example: A user inputs 5' into Length and the element uses the Length Calc formula: 
if(Length < 0', 0', if(Length > 3', 3', Length))   
and everything works as it should by stopping the element at 3' instead of 5' that the user input.

 

My question is, how do I constrain the user input Length parameter from having a negative value as an option? As we all know once a length parameter goes into a negative value it breaks the component. In this specific example I'm running a dimension from a centerline so having a negative value from center is a real possibility.

 

Thanks in advance!!

Accepted solutions (2)
9,075 Views
16 Replies
Replies (16)
Message 2 of 17

barthbradley
Consultant
Consultant


@mmarcarelliNX wrote:


if(Length < 0', 0', if(Length > 3', 3', Length))   

 

My question is, how do I constrain the user input Length parameter from having a negative value as an option? 

 




What's wrong with the parameter you have? "...<0...".  

 

 

 

 

0 Likes
Message 3 of 17

mmarcarelliNX
Contributor
Contributor

I'm using that concept to limit the placement of the object. However, if the user input parameter becomes a negative value the family still breaks (even though the object stays at a length of 0). Is there a way to limit that first user input parameter to accept a negative value without breaking the family?

0 Likes
Message 4 of 17

ToanDN
Consultant
Consultant
Are you saying some user deliberately enters something like -2'-0" in the field value?
0 Likes
Message 5 of 17

barthbradley
Consultant
Consultant

I just tested and your parameter works fine. Negative values are treated as <0.  

0 Likes
Message 6 of 17

barthbradley
Consultant
Consultant
Accepted solution

How about this?

 

Fired.png

 

Message 7 of 17

mmarcarelliNX
Contributor
Contributor

@barthbradley although I appreciate the sentiment, I'd put that in and no one would read it, I'm trying to script this in to enforce the issue.

 

I've attached a component in question, drag the arrow to the right of the center of the component. From the research I've done it doesn't look possible, but I'm all for any and all suggestions to hard code it into the component. 

0 Likes
Message 8 of 17

mmarcarelliNX
Contributor
Contributor

...apparently I can't upload .rfa files?

0 Likes
Message 9 of 17

barthbradley
Consultant
Consultant

@mmarcarelliNX wrote:

...apparently I can't upload .rfa files?


 

Yep, it has been a nightmare lately.

 

BTW, I was kidding about the "Warning".   Your formula works fine as is.  I'm not understanding the problem.  

 

Negative.png

0 Likes
Message 10 of 17

ToanDN
Consultant
Consultant
Accepted solution
Zip it and upload.
0 Likes
Message 11 of 17

mmarcarelliNX
Contributor
Contributor

for an ease of user control, having the instance grip control the instance length is important. In the snip below, as soon as the grips go to the right side of the CL, the length value goes negative and the component breaks.

Line Based Detail Item Building Symbol.PNG

 

interesting to note that length parameters can have a negative value but the dimension is what actually breaks, good to know.

 

Now, if anyone has any pearls of wisdom to have that slider start at the centerline and can slide to the left AND the right, I am all ears.

0 Likes
Message 12 of 17

mmarcarelliNX
Contributor
Contributor

third times a charm

0 Likes
Message 13 of 17

barthbradley
Consultant
Consultant

I'm still not following. Revit herself will throw a fricking fit if the user drags handle to a point that it breaks the family. You don't even need that Warning parameter. One is already hardwired into Revit.  

0 Likes
Message 14 of 17

bin
Advisor
Advisor

Might be a better solution, but here is what I have:

16102019.PNG

0 Likes
Message 15 of 17

SDavisLMKG6
Community Visitor
Community Visitor

bump

0 Likes
Message 16 of 17

mhiserZFHXS
Advisor
Advisor

What's the purpose of the bump? Are you having a similar issue?

0 Likes
Message 17 of 17

HVAC-Novice
Advisor
Advisor

You can vote on this idea that may resolve your original problem:

https://forums.autodesk.com/t5/revit-ideas/approved-ranges-for-numeric-parameters/idi-p/6323968

 

Revit Version: R2026.2
Hardware: i9 14900K, 64GB, Nvidia RTX 2000 Ada 16GB
Add-ins: ElumTools; Ripple-HVAC; ElectroBIM; Qbitec
0 Likes