User Parameters set to "No Units" behave like they are set to units downstream

User Parameters set to "No Units" behave like they are set to units downstream

Anonymous
Not applicable
4,145 Views
13 Replies
Message 1 of 14

User Parameters set to "No Units" behave like they are set to units downstream

Anonymous
Not applicable

I noticed an odd behavior in the User Parameters table.

 

When I create one user parameter and set it to use "No Units" in the drop down:

Inner_Wire_Count_Raw (Units Column= Blank) (Value Column = 18)

 

Then another,

Wire_Gap_Count (Units Column = Blank) (Value Column = 5)

 

And then try to subtract one from the other, by entering the following expression, with the user parameter in question also set to use "No Units"

 

Inner_Wire_Count_Raw - Wire_Gap_Count

 

Fusion 360 keeps the text red. The only workaround seems to be the familiar "/ 1 mm" attached to each input and "* 1mm" attached to the end of the expression, but if all the inputs and outputs of a calculation like the simple one above are unitless, then why does it need conversion in the first place? In other words, it seems to me that one unitless number, minus another unitless number, should not need /1 mm to be acceptable. I could understand if one of the inputs or output was in mm or some other unit, but its not.

 

Any ideas?

 

 

0 Likes
4,146 Views
13 Replies
Replies (13)
Message 2 of 14

Anonymous
Not applicable

I did another simple test in the Parameters Table, to test subtraction of values with "No Units" set:

 

Added a new user parameter myval1, set to "No Units", and entered 2 in the "expression" text box, then clicked ok.

Added a new user parameter myval2, set to "No Units", and entered 1 in the "expression" text box, then clicked ok.

Added a new user parameter myval3, set to "No Units", and entered myval1 - myval2 in the "expression" text box, then clicked ok.

 

This caused Fusion 360 to crash. I referenced this thread in the error report box after it crashed.

0 Likes
Message 3 of 14

Anonymous
Not applicable

I was unable to reproduce the above behavior on a new design project; simple subtraction of one unitless parameter from another works fine. This adds to my suspicion that this behavior is a bug, because I did reproduce it in my project (attached).

 

The project I was using has other parameters prior to the ones in question, but I am pretty sure the problematic ones discussed below are all free of unit "contamination" from upstream parameters. In fact, I rebuilt the last few parameters and made the behavior resurface in the attached project.

 

Looking in my project file (attached), the last 3 parameters in the parameters table is the focus of my description of the issue below:

Note that the actual parameters are different names because I had to rebuild them after the crash, but the symptoms are the same.

 

Assuming I did not break the general rules, can someone look under the hood and see why the dialog complains in red text when one tries to subtract the middle parameter from the first? (again, I am referencing only the bottom 3 parameters in the attachment Fusion 360 file).  All 3 of these user parameters are unitless, that is, set to "No Units".

 

I attempt to subtract the middle one, from the top one, but it won't accept a simple "this - that" syntax. I think Fusion somehow corrupted the "No Unit" status somehow, based on how the last entry is not accepting a simple subtraction expression without appending the * mm and /mm stuff. I did not reference any other parameters outside of these 3, so why does it want some unit conversion, when there should be no units to convert?

 

The third user parameter expression is:

 

( ( Inner_Wire_Count_Initial ) * 1 mm / 1 mm ) - ( Wire_Count_Of_Gap / 1 mm ) * 1 mm

 

Which is the issue. What I think Fusion 360 should accept in place of this (without complaining) is:

Inner_Wire_Count_Initial - Wire_Count_Of_Gap

 

Which, based on the actual values of the above variables, should be equivalent to entering:

18 - 5

 

Unless I am overlooking something, this may lead to uncovering a bug where "no Units" expressions are incorrectly not accepted, but only under certain conditions, since I could not make it happen in a new design project. I appreciate any thoughts, and I am willing to do more tests to narrow down the issue.

 

0 Likes
Message 4 of 14

Anonymous
Not applicable

Hello @Anonymous,

 

I work a lot with parameters, and at first I thought you were running into an error I had encountered where you can not have a parameter name match a part of the variable name, even if they are different, see here - but that doesn't seem to be the case here. Although, with your parameter naming methods, it may have occured.

 

I downloaded your file and was able to get it to function perfectly - no red text, no crashing, no incorrect behavor whatsoever. Very strange.

 

Screen Shot 2016-04-27 at 8.39.55 AM.png

 

If you find a way reproduce it, can you do a screencast for me? I really want to help - parameters are fun for me (strange I know.)

 

Good luck!

Message 5 of 14

Anonymous
Not applicable

Wow, that's curious, you got my file to work, and mine dosen't. Ha!

Now, just so folks don't think I'm crazy, here is a screenshot from my table, with the same text trying to be entered:

I appreciate your help, I will re-build it again and try to better isolate the triggering conditions. But comparing yours to mine suggests something is not the same. PC vs Apple? Don't know. I will also try to simply reload the file like you did, from the same one I posted above, and see if the red goes away...

 

Parameter_Error_1.png

0 Likes
Message 6 of 14

Anonymous
Not applicable

I see the same thing you did; that is, I opened the file I posted rather than continuing to work with original cloud-copy, and it works fine, just like your example:

Well that's another clue. "Something happened on the way to Memphis", apparently.

 

Parameter_No_Error_Opened_From_Desktop.png

 

 

0 Likes
Message 7 of 14

Anonymous
Not applicable

@Anonymous

 

That really is wild!

 

Mine is Mac - so if you have Windows maybe that is it? I hope someone with Windows comes along to test - I have a Windows at home so if no one responds by then I'll pull it in and test there.

 

Good luck!

 

Edit:

 

You responded as I did, hah!

 

Something went funny on your cloud copy I guess. Still odd, but now it's out of my realm of being able to help.

 

Hmm next time I have a parameter issue, I'll export and import and see if it helps...Usually I just start from scratch.Smiley Very Happy

0 Likes
Message 8 of 14

Anonymous
Not applicable

I closed and re-opened the cloud copy of the file, and it too works ok now. So, something got corrupted in the parameters table as it got built, but the "slate wipes clean" with a reload of the file by ether means, desktop copy or cloud copy.

 

I guess I will keep an eye out for this to present itself again. I almost wonder if a unitless parameter is used upstream in a unit-based calculation, like multplying it by a unit-based value, perhaps that can contaminate it's state to unit-based? I seem to remember I used one of my unitless parameters to multiply, but then deleted it and re-entered it prior to the tests above. I could see if parameters are sticky in the sense of getting labeled differently internally, then maybe this could linger if not cleaned properly prior to re-use. Just a theory for now...

 

I will continue working on my project, and see if it rears it's head again. If it does, I will try to isolate the sequence of events that make it happen so it can be fixed.

 

Thanks again for now.

 

Message 9 of 14

Anonymous
Not applicable

By the way, since you said you like to work with parameters alot, perhaps you can share with me a link or description for where I can find all the little math functions that work in the parameters table?

 

I looked high and low, and I ended up just trying ones used in Python, like floor() and mod() in the form of the percent sign, you know, codes like that. It would be nice to identify the full scope of what functions are accepted, or a simple confirmation that all or most Python math functions are accepted, etc. Its harder to cook without knowing what ingredients are on hand.

0 Likes
Message 10 of 14

Anonymous
Not applicable

I will be honest, I don't have a comprehensive list, I just try things until they work. Smiley Indifferent

 

There doesn't seem to be much of anything on parameters and accepted equations, variable names, ect. on the learning center that I can find. All my knowledge is trial and error and hints I have gleaned through exhaustive google searches and searches of the forums.

 

In general, the most common ones seem to be accepted. When something doesn't work, I just find another way to run the parameters.

 

I know this doesn't help much...I hope someone comes along to prove me wrong and link to a great page showing parameter capabilities. Smiley Very Happy

 

If you have an exact situation, I can probaly tell you how I would get it done. Other than that, I don't have a list or capability outline, unfortunately. Maybe I should put something together....

0 Likes
Message 11 of 14

Anonymous
Not applicable

Yeah, same here. All of my successes in introducting new math functions into the parameter expressions was trial and error too. I bet the community would benefit from a list or declaration of what programming universe the correct functions hail from. For me so far it smells like Python, but I don't know for sure.

 

I don't want to overly dilute this thread's topic, but I see we are both in the same boat on finding an allowed math functions list. Can anyone briefly enlighten us with a short answer?

 

I will continue to seek clues to the original issue as I work on my model.

 

0 Likes
Message 12 of 14

Anonymous
Not applicable

I ran into the symptom again after adding some more parameters and shortening the longest names.

 

The problem was fixed once again by saving the file to the cloud and re-opening it (with a simple integer number as a placeholder in the troubled expression).

 

OK, so here's a screenshot where I ran into the error:

 

Parameter_Error_2.png

 

 The actual error box that popped up when I try to re-enter as shown:

 

Parameter_Error_Box_2.png

Finally, a screenshot of the parameters table after saving, closing, and reopening the project from the cloud. Note that the last parameter in the table is now accepted, not red.

Parameter_No_Error_Opened_From_Cloud_1.png

 

So, there is something to this. It kinda seems like a flag or variable got set internally during or after the "/ 1 mm" and/or "* 1 mm" conversions, (which in my case were auto-completed or auto-re-factored by Fusion 360, after the expression text changed to black color, and I hit enter) that was not properly reset later on when conversion was not needed. A second possibility is that I am drawing a value from near the top of the table and using it below, so maybe the non sequential aspect of the order of calculations is creating the conditions for this issue to fire. But why does it work ok on a freshly opened copy of the file? I think that's the best clue so far.

 

Maybe this is enough of an evidence set to find what happens differently between a freshly opened file, and one that has been manipulated and added to from about the middle of the table to the bottom.

 

A tester should remember to put a simple number in the last parameter expression, then mess with the more complex ones above, using the conversion auto-complete of the "/ 1mm" and "* 1 mm" stuff within the expression box of a mm-based parameter, prior to working on the last parameter (the one with the problem).

 

Autocomplete basically rearranges the parenthesis and arguments when Fusion 360 sees a way forward to do it (that is as you type in the expression containing the extra conversions like "* 1 mm", or "/1 mm", the red text changes to black, and the entire text is often re-arranged upon pressing enter to a format it apparently prefers). I am suspicious of this being related or in the neighborhood of the cause of the bug, because it is necessairly pretty complex, and I had used it at least twice a little above the bottom entry.

 

Latest file related to these screenshots is attached below.

0 Likes
Message 13 of 14

HughesTooling
Consultant
Consultant

@Anonymous wrote:

By the way, since you said you like to work with parameters alot, perhaps you can share with me a link or description for where I can find all the little math functions that work in the parameters table?

 

I looked high and low, and I ended up just trying ones used in Python, like floor() and mod() in the form of the percent sign, you know, codes like that. It would be nice to identify the full scope of what functions are accepted, or a simple confirmation that all or most Python math functions are accepted, etc. Its harder to cook without knowing what ingredients are on hand.


 

 

Is this any help? If this happens before closing and open the file try a Compute All to see if that helps.

 

Mark

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Message 14 of 14

Anonymous
Not applicable
Yes, that was exactly what I needed. I missed that because I had given up on the help pages in general, because its sometimes hard to find where particular topics are within it. Thanks. Also, you said, "If this happens before closing and open the file try a Compute All to see if that helps" I am not familiar with "Compute All" or it's context in relation to Parameters. How do I do that? Is that some kind of command or button somewhere? Sorry if it's a dumb question, I simply never came across it before.
0 Likes