Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Does Mathcad Prime 7.0's Combo Box support units with exponents? I am trying to enter steel properties in and when I type in^4 and in^3 that is exactly how it looks instead of in⁴ or in³.
No, the combo box does not support units at all. (Why would you ever need units?)
The built-in table in Prime is better.
Not sure that I understand. Here is the example from Prime 7 help.
I would think the place to put the exponent would be in the data, not the units?
But would it accept square metres as a unit?
(Combo-box is a Premium feature, not accessible in Express)
Luc
Maybe limited to SI Base units.
By the way, like Fred, I also like tables.
Stupid limitation.
I wonder if this is another 3rd party add-on; just like the plot component: badly integrated.
Luc
Who knows...
The combo seems to me to be a convenient way to simultaneously select a set of parameters.
Of course there are many ways to accomplish this.
Maybe set up a table (with units) and use a combo box to select the table row. The table carries the unit definitions.
Not possible to return the indice from the combo box though I suppose it could be a variable. But how to populate the combo box when there are several hundred rows to fill. I use a script function to strip the first column of data to populate a dropdown list from which the indice is returned and hence the data from the table may be extracted.
A work around:
Have not downloaded P7 so i can't try myself.
Which unit do you get as finial result for the variables, if you put in^4 or the like in the box as was shown in the initial post? From the pic it looked like the in^4 are still labelled as unit and the OP did nor mention any error message he got, so I assumed it was just the ugly display he was moaning about.
No, it creates an error.
If I leave off the exponent and enter it as a straight length, it works fine. So it is recognizing the in^4 as a unit, but it's not recognizing the ^4 as an actual exponent. If I didn't have any error messages, I wouldn't have to come here looking for a solution.
Well, coming here is one thing...
You should report this serious bug to PTC.
Success!
Luc
I opened PTC case C15793488 with attached screen shot of Fred's work around which seems to be an excellent characterization of the problem.
Thanks, I also logged a case with the support assistant as well. Just wondering if anybody else had the same issue or if I was doing something wrong.
I tried the same method (3 values of the spring constant depending on 3 different materials) but failed.
It looks like "unt" is not declared a unit label in your version.
Try forcing it:
Thanks. By defining unt as a unit thru Labels is was accepted and worked.
Thanks again.
This oversight is a problem. I made a work around. I defined temporary units hidden in a collapsed area.
These units are equivalent, will work, and are never seen.
Bob
So I've played around with this quite a bit now. The thing to remember is that this component is dumb. It works, but it's dumb. It has no idea that it lives inside a Mathcad Prime document.
If you understand all this going in, it is quite functional and you can hide your "string" unit definitions in a collapsible area or keep commonly used "string" units in another worksheet that can be referenced before the Combo box (or after if you define them globally). It also allow you to hide the assignment expression/matrix, which is a throwback to legacy behavior and makes a very clean combo box. You can also use Math Formatting to shade the text and background color.
It's not ideal and in desperate need of a better translator for the units and values, but it is functional. I've attached a Prime 7.0 file with examples for making the "unit" strings more readable.
Wow! You just gave me the hint on how to type math characters that I couldn't type before: For example y-bar: a y with a horizontal bar over it:
I had to cheat here. Open MS Word and type the letter and the ascii code. In this case y0304. Then Alt-x that puts character 0304 over the y. Now your trick with the quotes and paste this between the quotes. Now delete the quote.
Bob
You can insert that character and other Combining Diacritical Marks from the Windows Character Map application. Select Group by: Unicode Sub-Range and you can find all kinds of interesting characters to insert into your variables.
Just to expand this a bit, it appears the entire combo box is just strings. For example, you can't enter numbers in scientific notation. or even 10*2.
30.0*10^6 is not recognized as a number, but as text. So in the follow-on steps you'll be using a string for math - which doesn't work. So you need to type out 30000000. In short, avoid all operators anywhere in the combo box(+,-,*,/,^).
I'd shake my head in disbelief, but ... hard to reach disbelief anymore.