cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How do I add a form field to formulas?

WM_11132074
3-Newcomer

How do I add a form field to formulas?

Hi

Is there a function in MathCad Prime (latest version or 9) where you can put a form field in formulas?

 

I'll give an example:
Variable = [form field] mm

 

This is because I've noticed that when I make spreadsheets and make different calculation formulas, e.g.: k = x mm * y mm
so often someone accidentally removes the units, and it then completely messes up all the calculations.

 

So I'm looking for something similar to Excel, where each value is in its own cell. If there was a form field in the formula, other parts wouldn't be easily editable.

2 REPLIES 2
StuartBruff
23-Emerald III
(To:WM_11132074)


@WM_11132074 wrote:

Hi

Is there a function in MathCad Prime (latest version or 9) where you can put a form field in formulas?

 

I'll give an example:
Variable = [form field] mm

 

This is because I've noticed that when I make spreadsheets and make different calculation formulas, e.g.: k = x mm * y mm
so often someone accidentally remo in ves the units, and it then completely messes up all the calculations.

 

So I'm looking for something similar to Excel, where each value is in its own cell. If there was a form field in the formula, other parts wouldn't be easily editable.


There is no specific form in Mathcad Prime 9, although there is a close match (the TextBox) in MP10.

 

2024 12 15 C.png

 

Stuart

Werner_E
25-Diamond I
(To:WM_11132074)

Additional to what Stuart already suggested, you could (mis)use a Prime input table for just one variable.

Sure, the user could still delete the whole expression, change the variable name, etc. making the whole sheet unusable. And he still could delete or change the unit, but in this case its more unlikely that this happens accidentally as the unit placeholder is farther away from the number.
Its also easy to still provide a default value with the correct unit in front of the table.

Werner_E_0-1734298523753.png

Of course the user may think that he must type in a unit as well and if he does, radius would end up to be of dimension area instead of length.

You could trap this by using an additional assignment using the "if" function.

But of course it would never be possible to catch all errors possible. If the user inserts a non-existing unit like dm or something invalid like a text instead of a number (maybe something like 2E02 which is not seen as a valid number), the input fails but the default set in front will not be in effect anymore, so the sheet will fails.

Werner_E_1-1734298833209.png

 

Announcements

Top Tags