So, negative values in family parameters. I am sure most of you know how to deal with this problem, but I still wanted to get it out there for those that don’t. By the way, this is my approach to dealing with this issue and I suspect that is not the only way of doing it so if you happen to know a better one – please share in the comments!

Unable to display content. Adobe Flash is required.

Ok, family parameters CAN take negative values, however once they are assign to a dimensional constraint – they won’t accept any negative values and will give you a “Parameter Offset has an invalid value.” error. Below I created a simple family where I nested another one that has a red cube in it.
The goal is to constrain this cube to the Left/Right reference plane and make it move from “Negative” to “Positive” side with a single “Offset” user parameter that can take both : negative and positive values.
Strategy for Negative Values in Family Parameters
Strategy for Values in Family Parameters
The solution comes at the cost of adding an extra Reference Plane (on the “Negative” side of the “Left/Right” ref plane) and two additional (non-user) family parameters with formulas that will drive the location of the box.
We need an additional reference plane on the “Negative” side of our “Left/Right” ref plane. This new plane needs to be constrained to the “Left/Right” one. Then the ref plane that our box is aligned to needs to be constrained to the new “Negative” ref plane (see image below).
Strategy for Negative Values in Family Parameters
Now, all we have left to do is to create family parameters that will drive these dimensions. User will only be allowed to tweak one of them – “Offset” parameter, which will be able to take either negative or positive values. Then we need one parameter to drive the “Negative” ref plane – I will call it “_negOffset” and another one that will drive the actual plane that drives the red box – I will call it “_posOffset”.
So, the idea is that we need to figure out whether user plugged in a positive or negative number. Depending on whether the number is positive or negative this will assign an absolute value of this number to one of “_negOffset” / “_posOffset” parameters and set another one to ZERO. Here is how you want to express this in formulas:
“_posOffset” = if(Offset > 0′, abs(Offset), 0′)
“_negOffset” = if(Offset < 0′, abs(Offset), 0′)
Strategy for Negative Values in Family Parameters
These two parameters drive the location of the box by checking if the value supplied by your user in the “Offset” field is below or above zero. all you need to do is to assign them to the dimensions…
Share →

Leave a Reply

Your email address will not be published. Required fields are marked *