User Parameter Units

User Parameter Units

mr.rickwright
Enthusiast Enthusiast
6,273 Views
28 Replies
Message 1 of 29

User Parameter Units

mr.rickwright
Enthusiast
Enthusiast

I plan on using user parameters to drive my design, so I am practicing with them.

I wanted to use one of the available units "%" which is under "Percentage" in the units drop-down when creating a user parameter.   It does allow you to enter a value such as 50.

Unfortunately the Unit does not appear in the units column and you cannot use the parameter in a formula in a sketch dimension.

Of course there is a work around; select "No Units" and enter 0.5 as the value.   

But it seems that the percentage units should work if they are in the list!

Am I doing something wrong?

0 Likes
6,274 Views
28 Replies
Replies (28)
Message 2 of 29

TheCADWhisperer
Consultant
Consultant

Can you File>Export and then Attach your *.f3d file here so that I do not have to rebuild the equations.

What happens if you multiply by 1 in?

0 Likes
Message 3 of 29

g-andresen
Consultant
Consultant

Hi,

more than 50 years ago, one of my trainers told me that technicians should leave the calculation with percentages to bankers and business people.

 

günther

Message 4 of 29

nate0520
Contributor
Contributor

You can skip to the very bottom of the post for the bottom line. But, I'm not sure what your knowledge base is, so I tried to explain the fundamentals of what I think is going on too. 

 

Important Background Information on Units, Dimensions, Physical Quantities

So the "Add User Parameter" dialog box has a drop-down field called "Unit". Within the drop-down list, there are different unit "categories," like length, mass, area, etc... These "unit categories" are physical quantities. Physical quantities are described in day-to-day life using certain units, as part of different unit systems like SI or imperial. It doesn't matter which unit system is used; we can convert from one unit to another unit as long as we know the appropriate conversion factor (for example, 1 inch = 2.54 * 1 centimeter, which changes units and unit systems; 1 centimeter = 10 * 1 millimeter changes units but stays in the same unit system).

 

It seems obvious, but you can't convert from units of inches to kilograms; or from feet to horsepower; or so forth. But why? It's because each of those units describe physical quantities that have different dimensions. Some physical quantities are described by a single dimension. For example, Length is described by just one dimension, which is simply "Length." Other physical quantities are described by several dimensions. For example, Area is described by Length*Length. Some physical quantities have quite strange dimensions, like Power which is described by Energy/Time (and it turns out that Time is simply Time, but Energy can be broken all the way down to Mass*Length^2 / Time^2). A familiar example of this is Torque. In the US, we hear about cars that can deliver so many foot-pounds. This is a unit, but it's also quite easy to see what the unit's dimensions are: Length*Mass. So, in order to convert between certain units, we have to know the appropriate conversion factor, AND the units have to be the same dimensions, meaning the units must measure the same physical quantity.

 

How This Relates to Fusion:

  • Fusion will automatically convert between units with the same dimensions (e.g. "test_calc_2" divides an inch value by a centimeter value -- it will first apply the correct conversion factor to change the cm value into inch-units, and then it will evaluate the whole expression in inch units). It will output a value in whatever unit requested (e.g. I could do a calculation where I plug in mm, cm, miles, and feet, but if I set its units to inches, it will convert all the values I gave it into inches first, and then evaluate the whole expression). 
  • Fusion cannot evaluate expressions that are not dimensionally consistent. These expressions have no physical meaning; they are nonsense -- like the example of converting feet into horsepower. They are two different physical quantities; it is impossible to equate them. Similarly, if I multiply a horsepower-value by a feet-value, the result is not a known physical quantity. The "horsepower-foot" doesn't describe anything in the physical world. 
  • Every unit category on the "Unit" drop-down in the "Add User Parameter" dialog box is treated as a unique dimension (or physical quantity) by Fusion. This means that "Percentage" is treated as a physical quantity. And remember from the last bullet point, we can't mix physical quantities together...

 

To summarize the problem you're facing:

Fusion seems to treat percentages as a measurement of a unique "physical quantity," just like an inch measures the physical quantity of length, or a kilogram measures mass (and a Newton measures force). Any mathematical expression in Fusion needs to have units that measure physical quantities which are all compatible with one another (i.e. units that Fusion knows a conversion for). But, there is no way to convert a "percentage" to anything else, because it's not actually a physical quantity and thus doesn't actually need a conversion... so Fusion throws an error. Seems like it was just an oversight when they programmed it.

 

My Suggestion:

As you said, the work-around is to change to "no-units"... However, you could set all your user parameters to unitless but add a comment stating what unit they should be in; and then set the value of your model parameter to the value of your unitless user parameter. It's not real pretty... but basically the issue at hand is a "bug" in how Fusion handles units. In my opinion, a percentage value should be automatically divided by 100 and converted to "unitless" for the sake of calculations; that would be the "conversion factor" to use for the "unit" of "percent". But [unfortunately] I don't help program Fusion, and I don't know how! 

 

Hope this helped

Nate

Message 5 of 29

mr.rickwright
Enthusiast
Enthusiast

Gunther;    great point, unfortunately my Career #1 was International Telecom Engineering where I learned a great deal about converting various units and systems (e.g.  nepers to db) but had to use percentages when calculating number of phone lines required for an office of n people.

Career #2 was Professional SCUBA  which required lots of percentage gas calculations to determine partial pressures.

Career #3 was Banking where I was allowed to use percentages and found that my new colleges apparently didn't know how (hence the financial crisis)   🙂

Message 6 of 29

mr.rickwright
Enthusiast
Enthusiast

Nate:    thanks for the recap on not mixing physical units.  That is something I had to teach my peers in the banking industry as my background was engineering, (see Gunther's Post)

 

I think the Short answer appears to be as you say (and as I suspected)   it's a BUG!

I would love to accept your answer as a solution but a workaround is hardly a solution 😉

 

Percentage is not a Physical unit anymore than a ratio is a physical unit or a "k"onstant.

I will submit an Idea to fix the bug.   If a program is going to have percentage in a choice of units it should handle it appropriately (as you say "divide by 100 and set to non Physical")

Message 7 of 29

TrippyLighting
Consultant
Consultant

1. That is not what the idea station is for!

2. The idea station is deprecated.

3. @ryan.bales this seems like a very low-hanging-fruit kind of bug that would seem not be too hard to fix 😉

 


EESignature

Message 8 of 29

nate0520
Contributor
Contributor

@mr.rickwright wrote:

[...]

I would love to accept your answer as a solution but a workaround is hardly a solution 😉


 

Agreed -- I always try to find a workaround so you can press on while the root of the issue is [hopefully] resolved! 

0 Likes
Message 9 of 29

mr.rickwright
Enthusiast
Enthusiast

... example file attached. I entered comments on each user parameter that describe how to recreate the issue.

0 Likes
Message 10 of 29

r.moss
Advocate
Advocate

Not being able to change units is a nuisance for another reason.

 

As there is no way of re-ordering or nesting user parameters, I have taken to creating spare "dummy" parameters that I can rename if I ever need them.  In my current drawing, I have 16 parameters with names like F1**** followed by F1spare1, F1spare2, F1spare3, then another 16 with names like F2*** (and F2spare 1,...) then another 16 with names like F3****.

 

I really can't face a list of 50 parameters that aren't in some kind of alphabetical order.  All it would take is a "sort" button to display them in a different order - is this too much to ask? 

 

So, I thought I had a work around but now I find I cannot change a spare parameter defined in mm into one in degrees.  Bother!  In future I will have to have to create some mm spares, some degree spares, some dimensionless spares...this is getting a bit silly.

Roger

Message 11 of 29

laughingcreek
Mentor
Mentor

I'm trying to understand why it's necessary for you to create so many extra parameters to handle the units.  Can you post a simple example?

0 Likes
Message 12 of 29

r.moss
Advocate
Advocate

Well, the design is evolving as I go along, I keep thinking of more dimensions that would be better put in as parameters.  Can you make a list of 50 parameters and guarantee that you won't think of any more?  So I need a few spare lengths & a few spare angles, otherwise any new parameter I add will be out of order.

Parameter_list.JPG

Basically I have three  fairings, each defined using 4 arcs (4 radii, 4 angles) plus metal thicknesses, widths etc.

 

Part of the problem is that Fusion doesn't handle conic curves properly (is this a bug or a feature? - a sketch containing a parabola cannot generate regions for extrusion - see screencast below) so I'm approximating each parabola as three arcs, chosen to match the profile within about 0.2 mm and give correct arc length and gradient change.

 

0 Likes
Message 13 of 29

laughingcreek
Mentor
Mentor

you didn't mention why you need extra parameters for dealing with units.  posting a SIMPLE example would help to clarify.

 

conic curves can be used in profiles, it least on my machine.  I see your using the move command to move sketch points, which isn't necessary for points on the originating sketch plane.  I suspect one or more of your pints hvae been moved off the sketch plane.  try selecting everything, right clicking and looking for a "move to sketch plane" option

laughingcreek_0-1589400499883.png

 

0 Likes
Message 14 of 29

jeff_strater
Community Manager
Community Manager

I've been trying all morning to parse all this and figure out the root problem(s). 

 

It seems that the OP (@mr.rickwright ) has discovered an issue with "%" as unit type, when applied to a distance parameter.  OK, that seems a legitimate bug.  To be honest, though, it is probably going to be low priority, since there is a convenient workaround (use a unitless parameter).  It is a valid argument to ask why, then, % is even there.   Good question, I'm not sure myself.

 

Second, @r.moss posted today that "Not being able to change units is a nuisance for another reason".  Though, I'm not sure I understand that reason.  The reasoning seems to be around needing to create lots of extra parameters to leave "space" for new parameters in the dialog.  OK, but I'm not sure I understand how not being able to change the units of a parameter relates to that.  Can you explain further?  It is certainly true that you cannot change the units of a parameter, and since you can change other attributes of a parameter, it seems like units should not be blocked, either.  But, then, I tried to think of a good use case for needing to change a unit type, and I couldn't come up with one.  Interested to hear what that might be.

 

Third, @r.moss asked about sorting of the table in he parameter dialog.  Good news and bad news here:  We are planning on implementing searching in this dialog (and more UI improvements in that dialog), but not sort.  The reason why sort doesn't make as much sense as search is that this dialog is grouped by component and feature.  So, what would it mean to, say, sort on parameter name?  You would just see a bunch of parameters, and lose the context of what feature/component they belong to.  But, with searching, you will be able to type part of the name you are interested in, and filter the list down to a much shorter list that should be easier to visually process.

 


Jeff Strater
Engineering Director
Message 15 of 29

laughingcreek
Mentor
Mentor

@jeff_strater wrote:

 

... It is certainly true that you cannot change the units of a parameter, and since you can change other attributes of a parameter, it seems like units should not be blocked, either.  But, then, I tried to think of a good use case for needing to change a unit type...

 

.. The reason why sort doesn't make as much sense as search is that this dialog is grouped by component and feature.  ....

 


jeff-I find hoping in and out of the parameters dialog box awkward at times.  I will occasionally assign a dimension to a line, and use that line to define a unit-less user parameter, or even put it directly into the qty field of a pattern, by dividing it by mm.   it's nice to be able to see everything right in a sketch.

 

agreed sorting component parameters might not make sense, but sorting the user parameters wold be nice.  particularly being able to manually sort them so yo can group them in a specific way.

 

0 Likes
Message 16 of 29

r.moss
Advocate
Advocate

Hi Jeff

 

Thanks for coming back on this. The only reason I say it's a nuisance not being able to change units is because I'm trying to find a work-around to the much bigger problem i.e. not being able to create a new User Parameter "where I want it in the list".

 

When I create a new user parameter it gets added on the bottom of the list; there's nothing I can do about this.  Effectively it is sorted by creation date.  I would like to be able to right-click on the list and "sort by name" or "insert new parameter here", but I can't do that.   I would like to be able to easily read this list and check it corresponds to the design parameters from other software (I am calculating the required fairing heights, arc radii in Matlab and then typing them into Fusion).

 

n.b I'm talking about the user parameter list, NOT the model parameter list.  I take your point about the parameters dialog being "grouped by component and feature" but that is the "Model parameters" box further down the window, not the "User parameters" box.   I am up to "d199" in the model parameters - I don't tend to look at that list as unless one is very careful adding comments, it is not easy to read.  I prefer to generate dimensions in the sketch using a suitably-named user parameter (e.g. F1R3 is radius of the third arc on fairing 1 and F1a3 is the corresponding angular extent) and then if need be adjust the value in the user parameter part of the parameters pop-up....I just assumed that was how one was meant to use it.  I guess I am fortunate only having 63 user parameters: if I had 300 it would be unbearable to have them in some random higgledy-piggledy order.

 

It is quite hard to define a complete list of all the parameters one might want before starting any sketching.  To avoid the annoyance of creating a new parameter "in the wrong place", I created a few spares.   Looking at the screenshot in my post above, before the "F2..." parameters there is F1spare2 and F1spare3.  I can rename these and keep their place...above them is F1_dC (corresponding to my "dC" variable in Matlab!) - this started as F1spare1 and I changed its name when I wanted a new user parameter on the end of the F1 list (i.e. above all the F2 units).  It's not a great way of working but it is better than nothing.

 

Now, I was able to rename F1spare1 as F1_dC because what I wanted (and already had) was a parameter with mm units.  If I had wanted a new parameter in degrees I would have cursed myself for not starting with some spare degree-unit names; I would have ended with an out of order name on the end of the list.    (I'm actually a great believer in units, I would never want to change them if I wasn't forced into it like this...though I can see people might want sometimes want to switch between displaying metres and mm, that's not actually changing the unit type.)

 

Just to illustrate the point I've thrown together a typical list of name, value pairs in Matlab.  The left two columns are not sorted, then the right-hand two columns are sorted by name:

F2R3           100      /    B1w            200  
F3a1           20.9     /    B2w            600  
F2a0           130.6    /    Boxes_t_end    63   
F2_creat_base  123.6    /    F12t_divider   1.61 
F2_crest_x     113.2    /    F1R0           87.7 
F1a0           65.3     /    F1R1           135.4
B2w            600      /    F1R2           259.9
F1R3           50       /    F1R3           50   
F1t_c          3.2      /    F1_box_h1      0    
B1w            200      /    F1_creat_base  61.8 
F2R1           270.8    /    F1_crest_x     56.6 
F3R0           90.7     /    F1_dC          0    
F1w            128.8    /    F1a0           65.3 
clearance      5        /    F1a1           22.2 
F3_crest_x     59.6     /    F1a_1          3.2  
F2a_exit       194.2    /    F1a_exit       97.1 
F1a1           22.2     /    F1t_c          3.2  
F3a0           68.3     /    F1t_end        2.5  
F2t_end        3.2      /    F1t_top        40   
F3a_1          6.2      /    F1w            128.8
F2t_top        80       /    F2R0           175.4
F1a_exit       97.1     /    F2R1           270.8
F3a1           12.9     /    F2R2           519.8
F3R2           262.9    /    F2R3           100  
F1R1           135.4    /    F2_box_h1      0    
F3R1           138.4    /    F2_creat_base  123.6
F12t_divider   1.61     /    F2_crest_x     113.2
F2a1           17.9     /    F2_dC          0    
Boxes_t_end    63       /    F2a0           130.6
F3R3           53       /    F2a1           17.9 
F3_dC          3        /    F2a1           44.4 
F2R0           175.4    /    F2a1           35.8 
F1_dC          0        /    F2a1           19.8 
F2a1           19.8     /    F2a_1          6.4  
F3_box_h1      3        /    F2a_exit       194.2
F2_dC          0        /    F2t_c          6.4  
F2R2           519.8    /    F2t_end        3.2  
F3a_exit       100.1    /    F2t_top        80   
F2t_c          6.4      /    F2w            0.5  
F2w            0.5      /    F3R0           90.7 
F3_creat_base  64.8     /    F3R1           138.4
F2a_1          6.4      /    F3R2           262.9
F3t_c          6.2      /    F3R3           53   
F1_crest_x     56.6     /    F3_box_h1      3    
F3t_top        43       /    F3_creat_base  64.8 
F1R2           259.9    /    F3_crest_x     59.6 
F2_box_h1      0        /    F3_dC          3    
F2a1           44.4     /    F3a0           68.3 
F1_creat_base  61.8     /    F3a1           9.9  
F2a1           35.8     /    F3a1           25.2 
F3a1           25.2     /    F3a1           20.9 
F1R0           87.7     /    F3a1           12.9 
F3a1           9.9      /    F3a_1          6.2  
F1_box_h1      0        /    F3a_exit       100.1
F1t_end        2.5      /    F3t_c          6.2  
F1a_1          3.2      /    F3t_top        43   
F1t_top        40       /    clearance      5    

It is just so much easier to check the sorted list.

 

Hundreds of people over the years have asked for a sorting capability - I am delighted to hear you are revising the parameters dialog but please make sure this feature is added.  It wouldn't matter whether it was name-based or just a manual drag up/down rearrangement to put them into some order that makes sense to the reader.

 

Best wishes

Roger

PS.  The tree structure in the Model Parameters list is nice - if you were revising the User Parameter list, could we have similar subfolders?  Then I could have just 4 top levels (F1, F2, F3, General) and expand them to add R0, R1, R2, R3, ao, a1, a2, a3 for each.

 

Message 17 of 29

r.moss
Advocate
Advocate

Hi,

Thanks for the tip.  I think they are actually all in the same plane - if I look edge-on they seem to be in line and if I select all and right-click, I don't get the option you suggest:

parabola bug.jpg

 

So I don't know what's wrong!  I am attaching the .f3d file below.

Roger

0 Likes
Message 18 of 29

r.moss
Advocate
Advocate

The other thing I meant to say was how nice it would be to have a polynomial curve feature.  When creating a parabola, y = k*x^2 is much more obvious than using a focal point.

-Roger

0 Likes
Message 19 of 29

TrippyLighting
Consultant
Consultant

Your sketch shows a profile for extrusion (or else) just fine. You'll just have to enable "Show profile":

 

Screen Shot 2020-05-14 at 6.24.55 AM.png

That can also be done by right-clicking on the sketch in the browser and selecting the appropriate menu item:

 

Screen Shot 2020-05-14 at 6.29.24 AM.png


EESignature

Message 20 of 29

r.moss
Advocate
Advocate

Wow!  So simple, thank you very much.

 

Just a couple of observations....having played with it a bit more, I have to say conic sections need "treating with care" in Fusion.  The maths is fairly well defined here and I've found what rho means in a previous post from 2015.  In principle it would be fairly easy to convert the Fusion control coordinates into an algebraic equation using a maths package (Matlab, Mathematica etc) (or vice-versa, starting with two control points where the curve intersects an end line).    I was wondering if I could demonstrate rho with a couple of dimensions:meaning of rho.JPG

Yes, the ratio of the two lengths is rho = 0.4 (so the definition in the 2015 post works for non-symmetrical arcs too).  I thought it would be "cool" to use parameters for the two dimensions here and calculate a third based on the ratio.  I made them into parameters, then changed them to "driven".  Unfortunately it didn't work out as planned: the lengths in the sketch change as I drag the points around but the user parameters retain their original value.  Oh well!

 

More interestingly, the "trim" and "extend" commands do different things i.e. one is not the inverse of the other.  The curve is defined by 2 end points, a control point (where the two tangents intersect) and the rho value.   "Trim" removes one end of the curve and generates a new control point so that the curve shape is preserved.  That's fine.

 

"Extend" moves one end point out along the tangent i.e. it keeps the existing control point and when the curve redraws, it does not follow the original line!  I tried "Fixing" the curve but the behaviour is the same.  So one can extend the curve, trim it back and you have a different curve to the original (see screencast).  Is this intentional?

 

Ideally one would have two options for "extend" - one "as is" (sliding the end point out along a fixed tangent) and another, if the curve is "Fixed" to extend the curve without changing the profile i.e. show the previously invisible part of the conic section.   For small rho this might mean, if no target object was found, that it would curve right around and generate a complete ellipse (why not?).

 

The current behaviour does not require "Extend" - one can just grab the end-point and drag it where you want it.  I don't think there's any way though of moving the end point along the curve as suggested above.  (This isn't a huge problem for me, I'm just mentioning it out of interest).

 

 

0 Likes