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!!
Gelöst! Gehe zur Lösung
Gelöst von ToanDN. Gehe zur Lösung
Gelöst von barthbradley. Gehe zur Lösung
@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...".
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?
I just tested and your parameter works fine. Negative values are treated as <0.
@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.
@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.
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.
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.
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.
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
Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.